mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-10-22 09:05:58 +00:00
MINOR updating previous request for ss3
This commit is contained in:
parent
8f0a81e1f5
commit
0533ad56e2
@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user