Cannot redeclare class upon installing a custom theme
Permalink 1 user found helpful
I created a VERY bare bones theme for Concrete5 to experiment with theme creation -- a single file titled full.php with the following content:
In the page_theme.php file I put the following:
I disabled all caching on my site then installed this theme. Everything seemed fine. Then I set the theme as active. Suddenly every page is giving me the same error:
Cannot redeclare class Concrete\Theme\Test\PageTheme
I cannot get to the admin panel to change the theme back to Elemental, either, as the admin panel throws the same error.
I tried deleting the contents of application/files/cache but that did not help.
What have I done?
<html> <head> <?php Loader::element('header_required', array('pageTitle' => $pageTitle)); ?> </head> <body> <?php $a = new Area('Main'); $a->setAreaGridMaximumColumns(12); $a->display($c); ?> <?php Loader::element('footer_required'); ?> </body> </html>
In the page_theme.php file I put the following:
<?php namespace Concrete\Theme\Test; use Concrete\Core\Page\Theme\Theme; class PageTheme extends Theme { protected $pThemeGridFrameworkHandle = 'bootstrap3'; }
I disabled all caching on my site then installed this theme. Everything seemed fine. Then I set the theme as active. Suddenly every page is giving me the same error:
Cannot redeclare class Concrete\Theme\Test\PageTheme
I cannot get to the admin panel to change the theme back to Elemental, either, as the admin panel throws the same error.
I tried deleting the contents of application/files/cache but that did not help.
What have I done?
This fixed it, I just needed to change the Concrete namespace to Application. Guess that's what I get for trying to copy and paste the Elemental theme and use that as a starting point
Fixed it for me too. Thanks.
Hi Mhawke !
This fix the first issue thanks, but now when i browse the site i got a error :
Call to a member function hasPageThemeGridFrameworkOffsetClasses() on a non-object
My custom theme is a copy of Elemetal
Any idea ?
Thanks A lot
This fix the first issue thanks, but now when i browse the site i got a error :
Call to a member function hasPageThemeGridFrameworkOffsetClasses() on a non-object
My custom theme is a copy of Elemetal
Any idea ?
Thanks A lot
This appears to be a different issue...
https://www.concrete5.org/developers/bugs/5-7-5-2/haspagethemegridfr...
https://www.concrete5.org/developers/bugs/5-7-5-2/haspagethemegridfr...
mine is like this
namespace Application\Theme\Test;
use Concrete\Core\Area\Layout\Preset\Provider\ThemeProviderInterface;
class PageTheme extends \Concrete\Core\Page\Theme\Theme implements ThemeProviderInterface
namespace Application\Theme\Test;
use Concrete\Core\Area\Layout\Preset\Provider\ThemeProviderInterface;
class PageTheme extends \Concrete\Core\Page\Theme\Theme implements ThemeProviderInterface
Can anyone give me some pointer with the issue I am having. I have also attach a screen shot
Cannot redeclare class Application\Theme\Test\PageTheme
Cannot redeclare class Application\Theme\Test\PageTheme
@cdowner
What is the name of your theme and the path to it?
Please zip your page_theme.php and attach it as a reply.
What is the name of your theme and the path to it?
Please zip your page_theme.php and attach it as a reply.
I have done the copied the elemental folder and change it to test in the Application folder
@cdowner
I think one of the problems might be an extra file in your theme called PageTheme.php.
application\themes\test\PageTheme.php
For more information there is a tutorial that cover this topic:
"How to copy the Elemental theme to use as a base for new themes"
http://documentation.concrete5.org/tutorials/how-to-copy-the-elemen...
I think one of the problems might be an extra file in your theme called PageTheme.php.
application\themes\test\PageTheme.php
For more information there is a tutorial that cover this topic:
"How to copy the Elemental theme to use as a base for new themes"
http://documentation.concrete5.org/tutorials/how-to-copy-the-elemen...
So from my understanding I should create my own theme and label it PageTheme as a PHP file?
As this is the only thing I have not done if the above mention is correct.
As this is the only thing I have not done if the above mention is correct.
@cdowner
Your test theme had a file called PageTheme.php that should not be there.
Your test theme had a file called PageTheme.php that should not be there.
the only php page in test folder I converted from the elemental file is named page_theme, I even copied that page and renamed it to PageTheme and that still didn't work.
<?php
namespace Application\Theme\Test;
use Concrete\Core\Area\Layout\Preset\Provider\ThemeProviderInterface;
class PageTheme extends
\Concrete\Core\Page\Theme\Theme implements ThemeProviderInterface
{
public function registerAssets()
{
<?php
namespace Application\Theme\Test;
use Concrete\Core\Area\Layout\Preset\Provider\ThemeProviderInterface;
class PageTheme extends
\Concrete\Core\Page\Theme\Theme implements ThemeProviderInterface
{
public function registerAssets()
{
I'm not sure why MrKDilkington isn't suggesting his own free add-on (modesty?) which installs a copy of the Elemental theme on your website.
http://www.concrete5.org/marketplace/themes/cloneamental...
http://www.concrete5.org/marketplace/themes/cloneamental...
I am unable to get to the site interface, but I will try to copy the file to the test and see if I can get it working that way
Do you get Dashboard access if you remove the 'application/themes/test' folder?
I get the interface but I am unable to do any editing
Have you installed the free Cloneamental theme or are you still fighting with your own?
How should I install it with out the interface
Sorry, I thought you meant that you couldn't edit page content. Are you getting error messages from the Dashboard? Tell me what's happening.
I get t the dashboard but it wont allow me to edit it, I remove the installation and DB and install fresh and keep getting the same error after I do the test folder and make the changes.
An unexpected error occurred.
Cannot redeclare class Application\Theme\Test\PageTheme
< Back to Home
with that on the dash board I am unable to edit anything.
I really appreciate all the help I have been getting with this.
An unexpected error occurred.
Cannot redeclare class Application\Theme\Test\PageTheme
< Back to Home
with that on the dash board I am unable to edit anything.
I really appreciate all the help I have been getting with this.
My point is that the Cloneamental theme is all you need to start customizing it. Make another fresh install (yes I know it's a pain) but don't do anything else regarding your Test theme. After your fresh install, head to the 'Dashbaord -> Extend concrete5 -> Get more themes' and search for 'Cloneamental' and install it. This will give you a copy of the core Elemental theme but in your 'application/theme/cloneamental/' folder so you can customize it.
After a fresh install it wont let me do that.
I am now reinstalling: Install concrete5 Version 5.6.3.4 which worked but I had a hard time upgrading so that was why I did a clean install
I am now reinstalling: Install concrete5 Version 5.6.3.4 which worked but I had a hard time upgrading so that was why I did a clean install
Version 5.6 CANNOT be upgraded to 5.7.
What do you mean 'it won't let me do that'. Error messages are the lifeblood of debugging so even if the error message doesn't mean anything to you, post it here so we can see what's happening.
What do you mean 'it won't let me do that'. Error messages are the lifeblood of debugging so even if the error message doesn't mean anything to you, post it here so we can see what's happening.
It wont let me edit 5.7 ver
What shows up on the screen when it 'won't let you edit'? Details, details, details please!!!
Please see the attached picture
Before you do a fresh install of 5.7, make sure you delete the 'application/theme/test' folder and then do the install. How are you re-installing it? Can you tell me your installation procedure?
Yes I am running Install concrete5 Version 5.7.5.3 now to see what happen
This is what I get after the installation and I am unable to do any edit
An unexpected error occurred.
file_exists(): open_basedir restriction in effect. File(C:/zpanel/hostdata/elroy/public_html/journelconsulting_com/concrete/themes/elemental/css/fonts.googleapis.com/css?family=Titillium+Web:200,400,700,900) is not within the allowed path(s): (c:/zpanel/hostdata/elroy/public_html/journelconsulting_com;c:/windows/temp)
< Back to Home
An unexpected error occurred.
file_exists(): open_basedir restriction in effect. File(C:/zpanel/hostdata/elroy/public_html/journelconsulting_com/concrete/themes/elemental/css/fonts.googleapis.com/css?family=Titillium+Web:200,400,700,900) is not within the allowed path(s): (c:/zpanel/hostdata/elroy/public_html/journelconsulting_com;c:/windows/temp)
< Back to Home
I am now running a fresh install without web theme
Install concrete5 Version 5.7.5.4
Install concrete5 Version 5.7.5.4
So can you get to 'Dashboard -> Extend concrete5 -> Get more themes' and search for 'Cloneamental' and install it?
Have the error message gone away? That seems like a hosting issue to me.
Have the error message gone away? That seems like a hosting issue to me.
I am getting:
Install concrete5
Version 5.7.5.4
{"error":{"message":"file_exists(): open_basedir restriction in effect. File(C:\/zpanel\/hostdata\/elroy\/public_html\/journelconsulting_com\/concrete\/themes\/elemental\/css\/fonts.googleapis.com\/css?family=Titillium+Web:200,400,700,900) is not within the allowed path(s): (c:\/zpanel\/hostdata\/elroy\/public_html\/journelconsulting_com;c:\/windows\/temp)"},"errors":["file_exists(): open_basedir restriction in effect. File(C:\/zpanel\/hostdata\/elroy\/public_html\/journelconsulting_com\/concrete\/themes\/elemental\/css\/fonts.googleapis.com\/css?family=Titillium+Web:200,400,700,900) is not within the allowed path(s): (c:\/zpanel\/hostdata\/elroy\/public_html\/journelconsulting_com;c:\/windows\/temp)"]}
Back
I am unable to edit anything.
Install concrete5
Version 5.7.5.4
{"error":{"message":"file_exists(): open_basedir restriction in effect. File(C:\/zpanel\/hostdata\/elroy\/public_html\/journelconsulting_com\/concrete\/themes\/elemental\/css\/fonts.googleapis.com\/css?family=Titillium+Web:200,400,700,900) is not within the allowed path(s): (c:\/zpanel\/hostdata\/elroy\/public_html\/journelconsulting_com;c:\/windows\/temp)"},"errors":["file_exists(): open_basedir restriction in effect. File(C:\/zpanel\/hostdata\/elroy\/public_html\/journelconsulting_com\/concrete\/themes\/elemental\/css\/fonts.googleapis.com\/css?family=Titillium+Web:200,400,700,900) is not within the allowed path(s): (c:\/zpanel\/hostdata\/elroy\/public_html\/journelconsulting_com;c:\/windows\/temp)"]}
Back
I am unable to edit anything.
When I click the back button I get:
An unexpected error occurred.
file_exists(): open_basedir restriction in effect. File(C:/zpanel/hostdata/elroy/public_html/journelconsulting_com/concrete/themes/elemental/css/fonts.googleapis.com/css?family=Titillium+Web:200,400,700,900) is not within the allowed path(s): (c:/zpanel/hostdata/elroy/public_html/journelconsulting_com;c:/windows/temp)
An unexpected error occurred.
file_exists(): open_basedir restriction in effect. File(C:/zpanel/hostdata/elroy/public_html/journelconsulting_com/concrete/themes/elemental/css/fonts.googleapis.com/css?family=Titillium+Web:200,400,700,900) is not within the allowed path(s): (c:/zpanel/hostdata/elroy/public_html/journelconsulting_com;c:/windows/temp)
I would put in a support ticket with your host. I believe that error is a server configuration issue.
the earlier version works well, I have services running on the server without any issues
Yeah, I know what you're saying but I'd still put in a ticket. Can't hurt and might help. 5.7 uses a lot of new stuff that older versions never attempted.
I do my own hosting
file_exists(): open_basedir restriction in effect.
When this is changed to none on the Vhost it completely turn off Apache services
php_admin_value open_basedir none
When this is changed to none on the Vhost it completely turn off Apache services
php_admin_value open_basedir none
Well then I can't help you because I don't do any hosting. This might help:
http://www.concrete5.org/community/forums/usage/stack-errors-on-app...
http://www.concrete5.org/community/forums/usage/stack-errors-on-app...
I'm sorry my friend. Apache configuration is not my speciality.
Your actually should be building your Test theme under the 'application/themes/test' folder because if you don't then the next time you update concrete5 to a new version, you will lose your work. If you build it in the 'application/themes/test' folder then your page_theme.php file should be: