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

Fatal Error after deleting a ModelAdmin


Reply


2 Posts   1183 Views

Avatar
christophermanning

Community Member, 3 Posts

7 April 2009 at 2:49pm

I created a ModelAdmin, ran /dev/build and then I found out I didn't need that ModelAdmin anymore and after I delete the ModelAdmin file and run /dev/build, I get the error:

Warning: include_once(C:/Program Files (x86)/Zend/Apache2/htdocs/coolwebsite/mysite/code/MyCatalogAdmin.php) [function.include-once]: failed to open stream: No such file or directory in C:\Program Files (x86)\Zend\Apache2\htdocs\coolwebsite\sapphire\core\Core.php on line 246

Warning: include_once() [function.include]: Failed opening 'C:/Program Files (x86)/Zend/Apache2/htdocs/coolwebsite/mysite/code/MyCatalogAdmin.php' for inclusion (include_path='.') in C:\Program Files (x86)\Zend\Apache2\htdocs\coolwebsite\sapphire\core\Core.php on line 246

Fatal error: Uncaught exception 'ReflectionException' with message 'Class MyCatalogAdmin does not exist' in C:\Program Files (x86)\Zend\Apache2\htdocs\coolwebsite\cms\code\CMSMenu.php:221 Stack trace: #0 C:\Program Files (x86)\Zend\Apache2\htdocs\coolwebsite\cms\code\CMSMenu.php(221): ReflectionClass->__construct('MyCatalogAdmin') #1 C:\Program Files (x86)\Zend\Apache2\htdocs\coolwebsite\cms\code\CMSMenu.php(19): CMSMenu::get_cms_classes() #2 C:\Program Files (x86)\Zend\Apache2\htdocs\coolwebsite\cms\_config.php(19): CMSMenu::populate_menu() #3 C:\Windows\Temp\silverstripe-cacheC--Program-Files-(x86)-Zend-Apache2-htdocs-coolwebsite\manifest-main(5633): require_once('C:\Program File...') #4 C:\Program Files (x86)\Zend\Apache2\htdocs\coolwebsite\sapphire\core\ManifestBuilder.php(70): require_once('C:\Windows\Temp...') #5 C:\Program Files (x86)\Zend\Apache2\htdocs\coolwebsite\sapphire\core\Core.php(165): ManifestBuilder::include_manifest() #6 C:\Program Files (x86)\Zend\Apache2\htdocs\coolwebsite\sapphire\main.php(58 in C:\Program Files (x86)\Zend\Apache2\htdocs\coolwebsite\cms\code\CMSMenu.php on line 221

How do you delete an existing ModelAdmin? I was under the impression, like all the other components, you just delete the file to remove the db references from it.

Avatar
ajshort

Community Member, 244 Posts

7 April 2009 at 4:09pm

Try visiting your site with "?flush=1" added to the URL - this forces the class location cache to regenerate itself.