BUGFIX: Ameneded r84151 so that the application order of extensions is the same as it was previously.

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@84156 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2009-08-11 05:41:01 +00:00
parent 60fde4ad54
commit 01640b32ae

View File

@ -418,9 +418,12 @@ abstract class Object {
// merge with existing static vars // merge with existing static vars
$extensions = self::uninherited_static($class, 'extensions'); $extensions = self::uninherited_static($class, 'extensions');
// We use unshift rather than push so that module extensions are added before built-in ones. // We use unshift rather than push so that module extensions are added before built-in ones.
// in particular, this ensures that the Versioned rewriting is done last. // in particular, this ensures that the Versioned rewriting is done last.
array_unshift($extensions, $extension); if($extensions) array_unshift($extensions, $extension);
else $extensions = array($extension);
self::set_static($class, 'extensions', $extensions); self::set_static($class, 'extensions', $extensions);
// load statics now for DataObject classes // load statics now for DataObject classes