From 8a5b360abd79069900c3d8dd87150ed91c36147b Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Sat, 26 Apr 2008 06:52:59 +0000 Subject: [PATCH] Merged revisions 52719 via svnmerge from http://svn.silverstripe.com/open/modules/sapphire/branches/2.2.2 ........ r52719 | sminnee | 2008-04-15 11:56:10 +1200 (Tue, 15 Apr 2008) | 1 line Fixed ContentController where ->dataRecord is empty ........ git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@53520 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/control/ContentController.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/control/ContentController.php b/core/control/ContentController.php index 8564164ca..f932bd307 100644 --- a/core/control/ContentController.php +++ b/core/control/ContentController.php @@ -92,7 +92,9 @@ class ContentController extends Controller { return; } - $this->dataRecord->extend('contentcontrollerInit', $this); + if($this->dataRecord) $this->dataRecord->extend('contentcontrollerInit', $this); + else singleton('SiteTree')->extend('contentcontrollerInit', $this); + if(Director::redirected_to()) return; Director::set_site_mode('site');