Merge pull request #6942 from open-sausages/pulls/3.4/fix-gridfield-state

BUG Ensure GridState_Component is added to GridField config
This commit is contained in:
Chris Joe 2017-07-21 10:54:07 +12:00 committed by GitHub
commit 3e8b636dc9

View File

@ -104,8 +104,6 @@ class GridField extends FormField {
}
$this->setConfig($config);
$this->config->addComponent(new GridState_Component());
$this->state = new GridState($this);
$this->addExtraClass('ss-gridfield');
@ -177,6 +175,10 @@ class GridField extends FormField {
public function setConfig(GridFieldConfig $config) {
$this->config = $config;
if (!$this->config->getComponentByType('GridState_Component')) {
$this->config->addComponent(new GridState_Component());
}
return $this;
}