Can't copy Single Page
Permalink
I just started programming with Concrete5 and this is probably a beginner mistake, but I just simply can't solve it.
So I want to copy the single Page "edit_profile" from "Concrete/single_pages/account." But after i copy the file (change the name) and install it through "dashboard/pages&themes/single pages), I can't access it. I get the error-message "Call to a member function output() on null". I have not a single Idea how to solve it.
I wanna thank you all for the answers in advance.
So I want to copy the single Page "edit_profile" from "Concrete/single_pages/account." But after i copy the file (change the name) and install it through "dashboard/pages&themes/single pages), I can't access it. I get the error-message "Call to a member function output() on null". I have not a single Idea how to solve it.
I wanna thank you all for the answers in advance.
You should also copy the controller for that page from concrete/controllers/single_page/account/edit_profile.php, this is the "brain" behind that page
I did that and renamed it like the singlepage but I get the same error message again.
Thanks for the response
Thanks for the response
Ok, so just to be clear you:
Copied concrete/single_pages/account/edit_profile.php to /application/single_pages/another_name.php
Copied concrete/controllers/single_page/account/edit_profile.php to /application/controllers/single_page/another_name.php
Updated the namespace in /application/controllers/single_page/another_name.php from Concrete\Controller\SinglePage\Account to Application\Controller\SinglePage
Cleared the Cache
Did a hard refresh (CTRL + F5)
And you're still getting this error?
Copied concrete/single_pages/account/edit_profile.php to /application/single_pages/another_name.php
Copied concrete/controllers/single_page/account/edit_profile.php to /application/controllers/single_page/another_name.php
Updated the namespace in /application/controllers/single_page/another_name.php from Concrete\Controller\SinglePage\Account to Application\Controller\SinglePage
Cleared the Cache
Did a hard refresh (CTRL + F5)
And you're still getting this error?
I'm working with XAMPP and I have this strange bug that I can't add single pages in "pages&themes/single_pages" when I save them in the application folder. I get the message "That specified path doesn't appear to be a valid static page." when I enter "Application/single_pages/name.php" in the form. (Probably my mistake, I'm new to this).
When I add a single_page that is saved in the concrete/single_pages folder. I don't have to write "Concrete/single_pages/name.php". I feel like it wants me to save in the Concrete folder. (I know that you should never save somehting in there)
Thank you so much for your patience.
When I add a single_page that is saved in the concrete/single_pages folder. I don't have to write "Concrete/single_pages/name.php". I feel like it wants me to save in the Concrete folder. (I know that you should never save somehting in there)
Thank you so much for your patience.
Can you please explain exactly what you're doing?
If you put a single page into application/single_pages/name.php in the Dashboard -> Pages & Themes -> Single Pages you would just enter "name" into the add single page box.
Do not save anything in the concrete directory if you want to keep it after an upgrade.
If you put a single page into application/single_pages/name.php in the Dashboard -> Pages & Themes -> Single Pages you would just enter "name" into the add single page box.
Do not save anything in the concrete directory if you want to keep it after an upgrade.
If i put name.php in Concrete/Single_pages, I only have to enter name.php. and get "Page Successfully Added." But when i put name.php into application/single_pages, i have no idea what to write, because whatever i write, I get the message "That specified path doesn't appear to be a valid static page."
What version are you working with? I've always just entered "name" without php and it's worked.
concrete5-8.1.0
Well it doesn't matter if add the ".php" or not
It works just fine in the Concrete folder, but it just simply wont work in the applicaion folder
Well it doesn't matter if add the ".php" or not
It works just fine in the Concrete folder, but it just simply wont work in the applicaion folder
Is there a reason you haven't upgraded to 8.2.1? There are a lot of bug fixes and security updates in there
No, I will now :))
Let you know if the bug will solve itself with the update
Let you know if the bug will solve itself with the update
So I tried this in 8.1 and it still works for me.
application/controllers/single_page/test.php
application/single_pages/test.php
Going to Dashboard -> Pages & Themes -> Single page enter "test" into the box and it added fine and when I access the page it says "in the controller view function" on the top of the page and "in the test.php" in the main part of the page.
application/controllers/single_page/test.php
<?php namespace Application\Controller\SinglePage; use PageController; class Test extends PageController { public function view() { echo 'in the controller view function'; } }
application/single_pages/test.php
<?php echo 'in the test.php';
Going to Dashboard -> Pages & Themes -> Single page enter "test" into the box and it added fine and when I access the page it says "in the controller view function" on the top of the page and "in the test.php" in the main part of the page.
I just completely reinstalled Concrete5 with the current version and the bug disappeared. I can now easily add single_pages. But i still can't manage to clone the "edit_profile" file. I have the controller in Application/controlllers/single_page and the single page in Application/single_pages and I can easily add the single_page in "pages&themes" but i still receive this "Call to a member function output() on null"
Can you post the exact code and where you placed it (including filename) like I did above so I can see what's going on?
Controller:
application/controllers/single_page/yes.php
application/controllers/single_page/yes.php
<?php namespace Application\Controller\SinglePage\Account; use Concrete\Core\Page\Controller\AccountPageController; use Concrete\Core\Validation\ResponseInterface; use Config; use UserInfo; use Exception; use Concrete\Core\Authentication\AuthenticationType; use Concrete\Core\Authentication\AuthenticationTypeFailureException; use Loader; use User; use UserAttributeKey; use Localization; class EditProfile extends AccountPageController {
Viewing 15 lines of 140 lines. View entire code block.
When I try to comment to post the code of the single_page, my account gets deactivated and I have to create a new one.
So
It is saved in
application/single_pages/yes.php
and its the same code as in Concrete/single_pages/account/edit_profile.php
So
It is saved in
application/single_pages/yes.php
and its the same code as in Concrete/single_pages/account/edit_profile.php
Your namespace is wrong, it should be Application\Controller\SinglePage and the class name should be Yes
It worked.
Thank you so much. :))))
Thank you so much. :))))