diff --git a/src/Forms/GridField/GridFieldDetailForm_ItemRequest.php b/src/Forms/GridField/GridFieldDetailForm_ItemRequest.php index f17d579b4c3..dacca37edfd 100644 --- a/src/Forms/GridField/GridFieldDetailForm_ItemRequest.php +++ b/src/Forms/GridField/GridFieldDetailForm_ItemRequest.php @@ -454,7 +454,7 @@ protected function getFormActions() $gridState = $this->gridField->getState(false); $actions->push(HiddenField::create($manager->getStateKey($this->gridField), null, $gridState)); - if ($manager instanceof GridFieldStateStoreInterface) { + if (ClassInfo::hasMethod($manager, 'getStateRequestVar')) { $stateRequestVar = $manager->getStateRequestVar(); $stateValue = $this->getRequest()->requestVar($stateRequestVar); if ($stateValue) { diff --git a/src/Forms/GridField/GridFieldStateStoreInterface.php b/src/Forms/GridField/GridFieldStateStoreInterface.php deleted file mode 100644 index 2037ad8eaef..00000000000 --- a/src/Forms/GridField/GridFieldStateStoreInterface.php +++ /dev/null @@ -1,10 +0,0 @@ -getStateManager(); - if ($stateManager instanceof GridFieldStateStoreInterface) { + if (ClassInfo::hasMethod($stateManager, 'storeState')) { $stateManager->storeState($this->state->getGridField(), $this->state->Value()); } } diff --git a/src/Forms/GridField/SessionGridFieldStateManager.php b/src/Forms/GridField/SessionGridFieldStateManager.php index 750c1f33665..4ed3133ea97 100644 --- a/src/Forms/GridField/SessionGridFieldStateManager.php +++ b/src/Forms/GridField/SessionGridFieldStateManager.php @@ -11,7 +11,7 @@ * (i.e. the state is changed from the default). * If a session state key is present in the request, it will always be used instead of generating a new one. */ -class SessionGridFieldStateManager implements GridFieldStateManagerInterface, GridFieldStateStoreInterface +class SessionGridFieldStateManager implements GridFieldStateManagerInterface { protected static $state_ids = [];