mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUG Ensure GridState_Component is added to GridField config even if we set config with GridField::setConfig
Fixes #6886
This commit is contained in:
parent
0c6851e597
commit
3dd3036792
@ -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…
Reference in New Issue
Block a user