5102 Posts in 1520 Topics by 1116 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1295 Views |
-
ModelAdmin::getManagedModels(). keep getting this error

20 April 2009 at 11:18pm Last edited: 20 April 2009 11:47pm
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.
-
Re: ModelAdmin::getManagedModels(). keep getting this error

21 April 2009 at 12:14am
PHP4 ?
I'm surprised Silverstripe runs at all ! ;)
-
Re: ModelAdmin::getManagedModels(). keep getting this error

21 April 2009 at 12:20am
ehm, sorry... PHP 5.16 ;)
Just tried the latest stable release, and that works fine!
so this only exist in the dailybuild versions -
Re: ModelAdmin::getManagedModels(). keep getting this error

16 June 2009 at 11:25pm
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.
| 1295 Views | ||
|
Page:
1
|
Go to Top |


