BUGFIX: check if the parent of the blog holder has a method called 'SideBar' before calling it

This commit is contained in:
James Kirkus-Lamont 2009-05-25 22:30:10 +00:00
parent b088e1ff8c
commit 5755d3e679
1 changed files with 3 additions and 1 deletions

View File

@ -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');
}