From 73cbd8df10f317fe38a81717151adb5491ad7b4d Mon Sep 17 00:00:00 2001 From: Guy Sartorelli Date: Thu, 17 Oct 2024 13:22:12 +1300 Subject: [PATCH] API Update code to reflect changes to LeftAndMain --- src/Controllers/CMSPageHistoryViewerController.php | 5 +++-- tests/Behat/features/restore-to-draft.feature | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Controllers/CMSPageHistoryViewerController.php b/src/Controllers/CMSPageHistoryViewerController.php index 47e1ee3..2c9cd01 100644 --- a/src/Controllers/CMSPageHistoryViewerController.php +++ b/src/Controllers/CMSPageHistoryViewerController.php @@ -4,6 +4,7 @@ use SilverStripe\CMS\Controllers\CMSMain; use SilverStripe\Forms\FieldList; +use SilverStripe\Forms\Form; use SilverStripe\Forms\HiddenField; use SilverStripe\VersionedAdmin\Forms\HistoryViewerField; @@ -29,9 +30,9 @@ class CMSPageHistoryViewerController extends CMSMain private static $ignore_menuitem = true; - public function getEditForm($id = null, $fields = null) + public function getEditForm($id = null, $fields = null): Form { - $record = $this->getRecord($id ?: $this->currentPageID()); + $record = $this->getRecord($id ?: $this->currentRecordID()); $form = parent::getEditForm($id); $form->addExtraClass('history-viewer__form'); diff --git a/tests/Behat/features/restore-to-draft.feature b/tests/Behat/features/restore-to-draft.feature index aab2b7e..9667b30 100644 --- a/tests/Behat/features/restore-to-draft.feature +++ b/tests/Behat/features/restore-to-draft.feature @@ -24,4 +24,4 @@ Feature: Restore to draft Then I press the "Restore to draft" button Then I should see "Successfully restored the page" in the "#Form_EditForm" element When I go to "/admin/pages" - And I should see "MyPage" in the ".cms-tree [data-pagetype='Page']:nth-of-type(2).status-addedtodraft" element + And I should see "MyPage" in the ".cms-tree [data-recordtype='Page']:nth-of-type(2).status-addedtodraft" element