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/list-view.feature b/tests/Behat/features/list-view.feature index 62e41c3..8853dd9 100644 --- a/tests/Behat/features/list-view.feature +++ b/tests/Behat/features/list-view.feature @@ -25,7 +25,7 @@ Feature: View a list of versions When I fill in the "Content" HTML field with "
Publish scenario
" And I press the "Publish" button And I wait 3 seconds - Then I should see a "Published 'Home' successfully." success toast + Then I should see a "Published Page "Home"" success toast When I click on the ".toast__close" element And I click on "History" in the header tabs And I wait for 3 seconds @@ -40,7 +40,7 @@ Feature: View a list of versions When I fill in the "Content" HTML field with "Save scenario
" And I press the "Save" button And I wait 3 seconds - Then I should see a "Saved 'Home' successfully." success toast + Then I should see a "Saved Page "Home"" success toast When I click on the ".toast__close" element And I click on "History" in the header tabs And I wait for 3 seconds @@ -55,7 +55,7 @@ Feature: View a list of versions When I fill in the "Content" HTML field with "Order scenario
" And I press the "Publish" button And I wait 3 seconds - Then I should see a "Published 'Home' successfully." success toast + Then I should see a "Published Page "Home"" success toast When I click on the ".toast__close" element And I click on "History" in the header tabs And I wait for 3 seconds 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