diff --git a/src/Extensions/LeftAndMainSubsites.php b/src/Extensions/LeftAndMainSubsites.php index e30c699d..6375e8df 100644 --- a/src/Extensions/LeftAndMainSubsites.php +++ b/src/Extensions/LeftAndMainSubsites.php @@ -317,7 +317,7 @@ public function onBeforeInit() $currentController = Controller::curr(); if ($currentController instanceof CMSPageEditController) { /** @var SiteTree $page */ - $page = $currentController->currentPage(); + $page = $currentController->currentRecord(); // If the page exists but doesn't belong to the requested subsite, redirect to admin/pages which // will show a list of the requested subsite's pages @@ -338,7 +338,7 @@ public function onBeforeInit() // Automatically redirect the session to appropriate subsite when requesting a record. // This is needed to properly initialise the session in situations where someone opens the CMS via a link. - $record = $this->owner->currentPage(); + $record = $this->owner->currentRecord(); if ($record && isset($record->SubsiteID, $this->owner->urlParams['ID']) && is_numeric($record->SubsiteID)