From 0d26650fc1be03aa036ad9d761dec2b1c7638c1e Mon Sep 17 00:00:00 2001 From: Guy Sartorelli <36352093+GuySartorelli@users.noreply.github.com> Date: Wed, 11 Dec 2024 10:30:58 +1300 Subject: [PATCH] ENH Update code to avoid using deprecated methods (#619) --- src/Extensions/LeftAndMainSubsites.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)