mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-10-22 09:05:58 +00:00
BUGFIX: check if the parent of the blog holder has a method called 'SideBar' before calling it
This commit is contained in:
parent
b088e1ff8c
commit
5755d3e679
@ -77,7 +77,9 @@ class BlogTree extends Page {
|
||||
}
|
||||
|
||||
function SideBar() {
|
||||
if ($this->InheritSideBar && $this->getParent()) return $this->getParent()->SideBar() ;
|
||||
if ($this->InheritSideBar && $this->getParent()) {
|
||||
if (method_exists($this->getParent(), 'SideBar')) return $this->getParent()->SideBar();
|
||||
}
|
||||
return DataObject::get_by_id('WidgetArea', $this->SideBarID);
|
||||
// @todo: This segfaults - investigate why then fix: return $this->getComponent('SideBar');
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user