From 5755d3e67964a728c7955a2e2a8a2d9aaa8ebb54 Mon Sep 17 00:00:00 2001 From: James Kirkus-Lamont Date: Mon, 25 May 2009 22:30:10 +0000 Subject: [PATCH] BUGFIX: check if the parent of the blog holder has a method called 'SideBar' before calling it --- code/BlogTree.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/BlogTree.php b/code/BlogTree.php index 2293ccf..fc327c1 100644 --- a/code/BlogTree.php +++ b/code/BlogTree.php @@ -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'); }