Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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
  • Loading branch information...
commit f6a8976121c27e076afd012f3451651a7fadef56 1 parent f89cb98
Ingo Schommer chillu authored sminnee committed
Showing with 3 additions and 2 deletions.
  1. +3 −2 core/model/SiteTree.php
5 core/model/SiteTree.php
View
@@ -301,7 +301,8 @@ public static function get_by_link($link, $cache = true) {
*/
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 @@ public static function page_type_classes() {
unset($classes[$idx]);
}
}
-
+
return $classes;
}
Please sign in to comment.
Something went wrong with that request. Please try again.