From 02c16e14db4ae4e3f9326db27273e015a9b918ec Mon Sep 17 00:00:00 2001 From: Guy Sartorelli Date: Wed, 2 Oct 2024 16:39:03 +1300 Subject: [PATCH] API Update references to API which has been renamed --- src/GridFieldArchiveAction.php | 2 +- src/GridFieldRestoreAction.php | 2 +- tests/php/GridFieldRestoreActionTest.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/GridFieldArchiveAction.php b/src/GridFieldArchiveAction.php index 3a120dd0..07f2aa70 100644 --- a/src/GridFieldArchiveAction.php +++ b/src/GridFieldArchiveAction.php @@ -153,7 +153,7 @@ public function getColumnContent($gridField, $record, $columnName) $field = $this->getArchiveAction($gridField, $record); if ($field) { - return $field->Field(); + return $field->renderField(); } return null; diff --git a/src/GridFieldRestoreAction.php b/src/GridFieldRestoreAction.php index 2ea82cbb..d4d92481 100644 --- a/src/GridFieldRestoreAction.php +++ b/src/GridFieldRestoreAction.php @@ -159,7 +159,7 @@ public function getColumnContent($gridField, $record, $columnName) { $field = $this->getRestoreAction($gridField, $record, $columnName); - return $field ? $field->Field() : null; + return $field ? $field->renderField() : null; } /** diff --git a/tests/php/GridFieldRestoreActionTest.php b/tests/php/GridFieldRestoreActionTest.php index 51a45e9a..08817260 100644 --- a/tests/php/GridFieldRestoreActionTest.php +++ b/tests/php/GridFieldRestoreActionTest.php @@ -67,7 +67,7 @@ public function testDontShowRestoreButtons() if (Security::getCurrentUser()) { Security::setCurrentUser(null); } - $content = new CSSContentParser($this->gridField->FieldHolder()); + $content = new CSSContentParser($this->gridField->renderFieldHolder()); // Check that there are content $this->assertEquals(4, count($content->getBySelector('.ss-gridfield-item') ?? [])); // Make sure that there are no restore buttons @@ -81,7 +81,7 @@ public function testDontShowRestoreButtons() public function testShowRestoreButtonsWithAdminPermission() { $this->logInWithPermission('ADMIN'); - $content = new CSSContentParser($this->gridField->FieldHolder()); + $content = new CSSContentParser($this->gridField->renderFieldHolder()); $restoreButtons = $content->getBySelector('.action-restore'); $this->assertEquals(3, count($restoreButtons ?? []), 'Restore buttons should show when logged in.'); }