mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-10-22 11:05:58 +02:00
Merge pull request #111 from logicbrush/tagcloudfix
Uncaught Exception: Object->__call(): the method 'data' does not exist on 'Security'
This commit is contained in:
commit
067003a6c3
@ -50,11 +50,14 @@ class BlogTree extends Page {
|
||||
*/
|
||||
static function current($page = null) {
|
||||
|
||||
if (!$page) {
|
||||
if (!$page && Controller::has_curr()) {
|
||||
$controller = Controller::curr();
|
||||
if($controller) $page = $controller->data();
|
||||
if ($controller->hasMethod('data')) {
|
||||
$page = $controller->data();
|
||||
}
|
||||
}
|
||||
|
||||
if ($page) {
|
||||
// If we _are_ a BlogTree, use us
|
||||
if ($page instanceof BlogTree) return $page;
|
||||
|
||||
@ -66,6 +69,7 @@ class BlogTree extends Page {
|
||||
$parent = $page->getParent();
|
||||
if($parent instanceof BlogTree) return $parent;
|
||||
}
|
||||
}
|
||||
|
||||
// Try to find a top-level BlogTree
|
||||
$top = DataObject::get_one('BlogTree', "\"ParentID\" = '0'");
|
||||
|
Loading…
Reference in New Issue
Block a user