FIX: Only unregister the relevant class when adding an extension.

This fixes an issue where the Config instance could not be injected, as
it would be immediately cleared.
This commit is contained in:
Andrew Short 2013-12-01 22:25:19 +11:00
parent aeb8814ddc
commit b7b041b435

View File

@ -550,7 +550,7 @@ abstract class Object {
Config::inst()->update($class, 'extensions', array($extension)); Config::inst()->update($class, 'extensions', array($extension));
Config::inst()->extraConfigSourcesChanged($class); Config::inst()->extraConfigSourcesChanged($class);
Injector::inst()->unregisterAllObjects(); Injector::inst()->unregisterNamedObject($class);
// load statics now for DataObject classes // load statics now for DataObject classes
if(is_subclass_of($class, 'DataObject')) { if(is_subclass_of($class, 'DataObject')) {