mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Removed custom interface for SessionGridFieldStateManager, the extra methods
will be incorporated into GridFieldStateManagerInterface in the future.
This commit is contained in:
parent
e9cd597a22
commit
898ef9ba31
@ -454,7 +454,7 @@ class GridFieldDetailForm_ItemRequest extends RequestHandler
|
|||||||
|
|
||||||
$gridState = $this->gridField->getState(false);
|
$gridState = $this->gridField->getState(false);
|
||||||
$actions->push(HiddenField::create($manager->getStateKey($this->gridField), null, $gridState));
|
$actions->push(HiddenField::create($manager->getStateKey($this->gridField), null, $gridState));
|
||||||
if ($manager instanceof GridFieldStateStoreInterface) {
|
if (ClassInfo::hasMethod($manager, 'getStateRequestVar')) {
|
||||||
$stateRequestVar = $manager->getStateRequestVar();
|
$stateRequestVar = $manager->getStateRequestVar();
|
||||||
$stateValue = $this->getRequest()->requestVar($stateRequestVar);
|
$stateValue = $this->getRequest()->requestVar($stateRequestVar);
|
||||||
if ($stateValue) {
|
if ($stateValue) {
|
||||||
|
@ -1,10 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace SilverStripe\Forms\GridField;
|
|
||||||
|
|
||||||
interface GridFieldStateStoreInterface
|
|
||||||
{
|
|
||||||
public function storeState(GridField $gridField, $value = null);
|
|
||||||
|
|
||||||
public function getStateRequestVar(): string;
|
|
||||||
}
|
|
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
namespace SilverStripe\Forms\GridField;
|
namespace SilverStripe\Forms\GridField;
|
||||||
|
|
||||||
|
use SilverStripe\Core\ClassInfo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Simple set of data, similar to stdClass, but without the notice-level
|
* Simple set of data, similar to stdClass, but without the notice-level
|
||||||
* errors.
|
* errors.
|
||||||
@ -86,7 +88,7 @@ class GridState_Data
|
|||||||
public function storeData()
|
public function storeData()
|
||||||
{
|
{
|
||||||
$stateManager = $this->getStateManager();
|
$stateManager = $this->getStateManager();
|
||||||
if ($stateManager instanceof GridFieldStateStoreInterface) {
|
if (ClassInfo::hasMethod($stateManager, 'storeState')) {
|
||||||
$stateManager->storeState($this->state->getGridField(), $this->state->Value());
|
$stateManager->storeState($this->state->getGridField(), $this->state->Value());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ use SilverStripe\Control\HTTPRequest;
|
|||||||
* (i.e. the state is changed from the default).
|
* (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.
|
* 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 = [];
|
protected static $state_ids = [];
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user