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

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@102026 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2010-04-01 02:22:05 +00:00 committed by Sam Minnee
parent f89cb98d2a
commit f6a8976121

View File

@ -301,7 +301,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
@ -324,7 +325,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
unset($classes[$idx]);
}
}
return $classes;
}