Jump to:

23460 Posts in 18907 Topics by 2877 members

General Questions

SilverStripe Forums » General Questions » Fatal Error after deleting a ModelAdmin

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

Page: 1
Go to End
Author Topic: 1136 Views
  • christophermanning
    Community Member
    3 Posts

    Fatal Error after deleting a ModelAdmin Link to this post

    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.

  • ajshort
    Community Member
    244 Posts

    Re: Fatal Error after deleting a ModelAdmin Link to this post

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

Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.