Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

[User Error] Uncaught ReflectionException: Class UserDefinedForm does not exist


Reply


2 Posts   1939 Views

Avatar
Dannyp

Community Member, 2 Posts

16 December 2012 at 2:18am

Hello,

I have recently moved a clients site from one shared hosting package to another and now when i login and get redirected to /admin/pages i get the following error:

I'm not very familiar with Silverstripe so please bare with me and thanks in advance for any help.

[User Error] Uncaught ReflectionException: Class UserDefinedForm does not exist
GET /admin/pages

Line 819 in /Applications/MAMP/htdocs/exeter/framework/control/injector/Injector.php

Source

810 class InjectionCreator {
811 /**
812 *
813 * @param string $object 814 * A string representation of the class to create
815 * @param array $params 816 * An array of parameters to be passed to the constructor
817 */
818 public function create(Injector $injector, $class, $params = array()) {
819 $reflector = new ReflectionClass($class);
820 if (count($params)) {
821 return $reflector->newInstanceArgs($injector->convertServiceProperty($params));
822 }
823 return $reflector->newInstance();
824 }
825 }
Trace

ReflectionClass->__construct(UserDefinedForm)
Injector.php:819
InjectionCreator->create(Injector,UserDefinedForm,Array)
Injector.php:470
Injector->instantiate(Array,UserDefinedForm)
Injector.php:763
Injector->get(UserDefinedForm)
Core.php:374
singleton(UserDefinedForm)
SiteTree.php:346
SiteTree::page_type_classes()
CMSMain.php:247
CMSMain->SearchForm()
ViewableData.php:366
ViewableData->obj(SearchForm,,,1)
ViewableData.php:443
ViewableData->XML_val(SearchForm,,1)
call_user_func_array(Array,Array)
SSViewer.php:128
SSViewer_Scope->__call(XML_val,Array)
SSViewer.php:459
SSViewer_DataPresenter->__call(XML_val,Array)
.cache.cms.templates.Includes.CMSPagesController_Tools.ss:10
SSViewer_DataPresenter->XML_val(SearchForm,,1)
.cache.cms.templates.Includes.CMSPagesController_Tools.ss:10
include(/Applications/MAMP/htdocs/exeter/silverstripe-cache/.cache.cms.templates.Includes.CMSPagesController_Tools.ss)
SSViewer.php:778
SSViewer->includeGeneratedTemplate(/Applications/MAMP/htdocs/exeter/silverstripe-cache/.cache.cms.templates.Includes.CMSPagesController_Tools.ss,CMSPagesController,,Array)
SSViewer.php:844
SSViewer->process(CMSPagesController)
LeftAndMain.php:1069
LeftAndMain->Tools()
ViewableData.php:366
ViewableData->obj(Tools,,,1)
ViewableData.php:443
ViewableData->XML_val(Tools,,1)
call_user_func_array(Array,Array)
SSViewer.php:128
SSViewer_Scope->__call(XML_val,Array)
SSViewer.php:459
SSViewer_DataPresenter->__call(XML_val,Array)
.cache.cms.templates.Includes.CMSPagesController_Content.ss:66
SSViewer_DataPresenter->XML_val(Tools,,1)
.cache.cms.templates.Includes.CMSPagesController_Content.ss:66
include(/Applications/MAMP/htdocs/exeter/silverstripe-cache/.cache.cms.templates.Includes.CMSPagesController_Content.ss)
SSViewer.php:778
SSViewer->includeGeneratedTemplate(/Applications/MAMP/htdocs/exeter/silverstripe-cache/.cache.cms.templates.Includes.CMSPagesController_Content.ss,CMSPagesController,,Array)
SSViewer.php:844
SSViewer->process(CMSPagesController,)
ViewableData.php:335
ViewableData->renderWith(Array)
LeftAndMain.php:562
LeftAndMain->Content()
ViewableData.php:366
ViewableData->obj(Content,,,1)
ViewableData.php:443
ViewableData->XML_val(Content,,1)
call_user_func_array(Array,Array)
SSViewer.php:128
SSViewer_Scope->__call(XML_val,Array)
SSViewer.php:459
SSViewer_DataPresenter->__call(XML_val,Array)
.cache.framework.admin.templates.LeftAndMain.ss:36
SSViewer_DataPresenter->XML_val(Content,,1)
.cache.framework.admin.templates.LeftAndMain.ss:36
include(/Applications/MAMP/htdocs/exeter/silverstripe-cache/.cache.framework.admin.templates.LeftAndMain.ss)
SSViewer.php:778
SSViewer->includeGeneratedTemplate(/Applications/MAMP/htdocs/exeter/silverstripe-cache/.cache.framework.admin.templates.LeftAndMain.ss,CMSPagesController,,Array)
SSViewer.php:844
SSViewer->process(CMSPagesController,)
ViewableData.php:335
ViewableData->renderWith(SSViewer)
LeftAndMain.php:450
{closure}()
call_user_func(Closure)
PjaxResponseNegotiator.php:73
PjaxResponseNegotiator->respond(SS_HTTPRequest)
LeftAndMain.php:368
LeftAndMain->index(SS_HTTPRequest)
CMSMain.php:89
CMSMain->index(SS_HTTPRequest)
Controller.php:195
Controller->handleAction(SS_HTTPRequest)
RequestHandler.php:168
RequestHandler->handleRequest(SS_HTTPRequest,DataModel)
Controller.php:149
Controller->handleRequest(SS_HTTPRequest,DataModel)
LeftAndMain.php:340
LeftAndMain->handleRequest(SS_HTTPRequest,DataModel)
AdminRootController.php:88
AdminRootController->handleRequest(SS_HTTPRequest,DataModel)
Director.php:281
Director::handleRequest(SS_HTTPRequest,Session,DataModel)
Director.php:112
Director::direct(/admin/pages,DataModel)
main.php:126

Avatar
Dannyp

Community Member, 2 Posts

16 December 2012 at 2:41am

After a little bit more searching i found the solution - rebuilding the database via /dev/build fixed the issue.

Thanks

Danny