Skip to content

Commit

Permalink
ENH Update code to avoid using deprecated methods
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli committed Dec 8, 2024
1 parent a9f842e commit 7075771
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Extensions/LeftAndMainSubsites.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down

0 comments on commit 7075771

Please sign in to comment.