BUGFIX Fixed SiteTree::page_type_classes() removal of base class (was broken if database driver returned classes in arbitrary order, e.g. in Postgres) (from r102026)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112058 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2010-10-13 01:28:02 +00:00
parent 0cc6d2b764
commit ddf66c1fec

View File

@ -295,7 +295,8 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
*/
public static function page_type_classes() {
$classes = ClassInfo::getValidSubClasses();
array_shift($classes);
if($baseClassIndex = array_search('SiteTree', $classes)) unset($classes[$baseClassIndex]);
$kill_ancestors = array();
// figure out if there are any classes we don't want to appear
@ -318,7 +319,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
unset($classes[$idx]);
}
}
return $classes;
}