Hey guys,
I did a fresh install on a webserver that is not my own. Now I get the problem "[User Error] Bad class to singleton() - PageKarriere" when accessing the /admin panel (via silverstripe/index.php/admin because i do not have mod_rewrite on the server).
Note: PageKarriere is a page type i have customized for the website.
Now when i delete the custom page types and leave only the "page.ss" in /mysite/code, everything works fine. But as soon as i add one of the custom pages (which already work on another webserver and on my localhost), i get the bad class to singleton() error again.
Can anyone explain the function singleton() to me and maybe what the problem is?
On the forums i only found "not really" related topics, which all describe a different problem which cause the singleton() error.
Find the full error code below.
I know that this is probably a very easy problem, but i am just not seeing the solution ^^
Thanks in advance for all answers i get =)
Kindest Regards,
Worp
[User Error] Bad class to singleton() - PageKarriere
GET /silverstripe/index.php/admin
Line 334 in /www/test.ceceka.de/htdocs/silverstripe/sapphire/core/Core.php
Source
325 *
326 * @param string $className
327 * @return Object
328 */
329 function singleton($className) {
330 global $_SINGLETONS;
331 if(!isset($className)) user_error("singleton() Called without a class", E_USER_ERROR);
332 if(!is_string($className)) user_error("singleton() passed bad class_name: " . var_export($className,true), E_USER_ERROR);
333 if(!isset($_SINGLETONS[$className])) {
334 if(!class_exists($className)) user_error("Bad class to singleton() - $className", E_USER_ERROR);
335 $_SINGLETONS[$className] = Object::strong_create($className,null, true);
336 if(!$_SINGLETONS[$className]) user_error("singleton() Unknown class '$className'", E_USER_ERROR);
337 }
338 return $_SINGLETONS[$className];
339 }
340
Trace
* Bad class to singleton() - PageKarriere
Line 334 of Core.php
* singleton(PageKarriere)
Line 322 of SiteTree.php
* SiteTree::page_type_classes()
Line 341 of CMSMain.php
* CMSMain->PageTypes()
Line 1188 of CMSMain.php
* CMSMain->AddPageOptionsForm()
Line 369 of ViewableData.php
* ViewableData->obj(AddPageOptionsForm)
Line 45 of .cache.www.test.ceceka.de.htdocs.silverstripe.cms.templates.Includes.CMSMain_left.ss
* include(/www/test.ceceka.de/htdocs/silverstripe/silverstripe-cache/.cache.www.test.ceceka.de.htdocs.silverstripe.cms.templates.Includes.CMSMain_left.ss)
Line 420 of SSViewer.php
* SSViewer->process(CMSMain)
Line 342 of ViewableData.php
* ViewableData->renderWith(Array)
Line 481 of LeftAndMain.php
* LeftAndMain->Left()
Line 369 of ViewableData.php
* ViewableData->obj(Left,,,1)
Line 446 of ViewableData.php
* ViewableData->XML_val(Left,,1)
Line 59 of .cache.www.test.ceceka.de.htdocs.silverstripe.cms.templates.LeftAndMain.ss
* include(/www/test.ceceka.de/htdocs/silverstripe/silverstripe-cache/.cache.www.test.ceceka.de.htdocs.silverstripe.cms.templates.LeftAndMain.ss)
Line 420 of SSViewer.php
* SSViewer->process(CMSMain)
Line 202 of Controller.php
* Controller->handleAction(SS_HTTPRequest)
Line 137 of RequestHandler.php
* RequestHandler->handleRequest(SS_HTTPRequest)
Line 147 of Controller.php
* Controller->handleRequest(SS_HTTPRequest)
Line 281 of Director.php
* Director::handleRequest(SS_HTTPRequest,Session)
Line 124 of Director.php
* Director::direct(admin)
Line 127 of main.php
* require_once(/www/test.ceceka.de/htdocs/silverstripe/sapphire/main.php)
Line 63 of index.php