diff --git a/src/Forms/GridField/GridFieldDetailForm_ItemRequest.php b/src/Forms/GridField/GridFieldDetailForm_ItemRequest.php index f17d579b4..dacca37ed 100644 --- a/src/Forms/GridField/GridFieldDetailForm_ItemRequest.php +++ b/src/Forms/GridField/GridFieldDetailForm_ItemRequest.php @@ -454,7 +454,7 @@ class GridFieldDetailForm_ItemRequest extends RequestHandler $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 2037ad8ea..000000000 --- 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 750c1f336..4ed3133ea 100644 --- a/src/Forms/GridField/SessionGridFieldStateManager.php +++ b/src/Forms/GridField/SessionGridFieldStateManager.php @@ -11,7 +11,7 @@ use SilverStripe\Control\HTTPRequest; * (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 = [];