Skip to content

Commit

Permalink
BUGFIX Fixed SiteTree::page_type_classes() removal of base class (was…
Browse files Browse the repository at this point in the history
… 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
  • Loading branch information
chillu authored and Sam Minnee committed Feb 2, 2011
1 parent f89cb98 commit f6a8976
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core/model/SiteTree.php
Expand Up @@ -301,7 +301,8 @@ public static function get_by_link($link, $cache = true) {
*/ */
public static function page_type_classes() { public static function page_type_classes() {
$classes = ClassInfo::getValidSubClasses(); $classes = ClassInfo::getValidSubClasses();
array_shift($classes); if($baseClassIndex = array_search('SiteTree', $classes)) unset($classes[$baseClassIndex]);

$kill_ancestors = array(); $kill_ancestors = array();


// figure out if there are any classes we don't want to appear // figure out if there are any classes we don't want to appear
Expand All @@ -324,7 +325,7 @@ public static function page_type_classes() {
unset($classes[$idx]); unset($classes[$idx]);
} }
} }

return $classes; return $classes;
} }


Expand Down

0 comments on commit f6a8976

Please sign in to comment.