mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
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:
commit
3e8b636dc9
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user