diff --git a/src/ChangeSetItem.php b/src/ChangeSetItem.php index 6811a783..2a1b0880 100644 --- a/src/ChangeSetItem.php +++ b/src/ChangeSetItem.php @@ -531,18 +531,10 @@ public function getPreviewLinks() return $links; } - /** - * Get edit link for this item - * - * @return string - */ - public function CMSEditLink() + public function CMSEditLink(): ?string { $link = $this->getObjectInStage(Versioned::DRAFT); - if ($link instanceof CMSPreviewable) { - return $link->CMSEditLink(); - } - return null; + return $link->CMSEditLink(); } /** diff --git a/src/RestoreAction.php b/src/RestoreAction.php index a9739edc..678cb6ba 100644 --- a/src/RestoreAction.php +++ b/src/RestoreAction.php @@ -88,9 +88,9 @@ public static function getRestoreMessage($originalItem, $restoredItem, $changedL $restoredID = $restoredItem->Title ?: $restoredItem->ID; $restoredType = strtolower($restoredItem->i18n_singular_name() ?? ''); - if (method_exists($restoredItem, 'CMSEditLink') && - $restoredItem->CMSEditLink()) { - $restoredID = sprintf('%s', $restoredItem->CMSEditLink(), $restoredID); + $editLink = $restoredItem->CMSEditLink(); + if ($editLink) { + $restoredID = sprintf('%s', $editLink, $restoredID); } if ($originalItem->URLSegment !== $restoredItem->URLSegment) {