Fixed ContentController where ->dataRecord is empty

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.2.2@52712 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2008-04-14 23:56:10 +00:00
parent b3128b280f
commit 6edc1b6f99

View File

@ -93,7 +93,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');