Jump to:

5450 Posts in 1672 Topics by 1197 members

Customising the CMS

SilverStripe Forums » Customising the CMS » ModelAdmin::getManagedModels(). keep getting this error

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

Page: 1
Go to End
Author Topic: 1461 Views
  • lxer
    Avatar
    Community Member
    16 Posts

    ModelAdmin::getManagedModels(). keep getting this error Link to this post

    I moved my site to the production server, but now the ModelAdmin stuff doesn't work, and I keep getting this error:

    [User Error] ModelAdmin::getManagedModels(): You need to specify at least one DataObject subclass in protected static $managed_models. Make sure the visibility of your property is set to "protected"

    but the property is already protected!
    $managed_models seems to be empty.

    Infact, I started from scratch again (fresh install), and did exactly as http://doc.silverstripe.com/doku.php?id=modeladmin
    but I keep getting that error...
    (server: php 4.16 , MySQL 5.0.45)

    On my test environment everything works fine.

  • Fuzz10
    Avatar
    Community Member
    786 Posts

    Re: ModelAdmin::getManagedModels(). keep getting this error Link to this post

    PHP4 ?

    I'm surprised Silverstripe runs at all ! ;)

  • lxer
    Avatar
    Community Member
    16 Posts

    Re: ModelAdmin::getManagedModels(). keep getting this error Link to this post

    ehm, sorry... PHP 5.16 ;)

    Just tried the latest stable release, and that works fine!
    so this only exist in the dailybuild versions

  • Quirk
    Avatar
    Community Member
    1 Post

    Re: ModelAdmin::getManagedModels(). keep getting this error Link to this post

    Hi,

    I just stumbled upon the same bug. It's a bug in php's reflection API (http://bugs.php.net/bug.php?id=38132).

    The keys for the managed models array get corrupt when the Object::get_static function uses the Reflection API to get the static vars of an admin class. Thus silverstripe cannot find it using the stat function and thus thinks no managed models have been specified for that admin.

    We used PHP version 5.16 as well on that server. We switched to PHP version 5.2 and everything works out fine. So just upgrade and it should work fine.

    1461 Views
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.