MINOR updating previous request for ss3

This commit is contained in:
mattclegg 2012-07-30 22:46:58 +01:00
parent 8f0a81e1f5
commit 0533ad56e2
1 changed files with 3 additions and 3 deletions

View File

@ -61,12 +61,12 @@ class BlogTree extends Page {
if($top) return $top;
// Try to find any BlogTree that is not inside another BlogTree
foreach(DataObject::get('BlogTree') as $tree) {
if($blogTrees=DataObject::get('BlogTree')) foreach($blogTrees as $tree) {
if(!($tree->getParent() instanceof BlogTree)) return $tree;
}
// This shouldn't be possible, but assuming the above fails, just return anything you can get
return DataObject::get_one('BlogTree');
return $blogTrees;
}
/* ----------- ACCESSOR OVERRIDES -------------- */
@ -349,4 +349,4 @@ class BlogTree_Controller extends Page_Controller {
return date("Y", mktime(0, 0, 0, date('m'), 1, $date));
}
}
}
}