diff --git a/core/control/ContentController.php b/core/control/ContentController.php index 83be6c8d2..6cbf494a7 100644 --- a/core/control/ContentController.php +++ b/core/control/ContentController.php @@ -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');