mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #4778 from assertchris/prevent-multiple-states-added-to-single-config
Preventing multiple states added to single config
This commit is contained in:
commit
37957b7ee8
@ -105,7 +105,12 @@ class GridField extends FormField {
|
|||||||
|
|
||||||
$this->setConfig($config);
|
$this->setConfig($config);
|
||||||
|
|
||||||
|
$state = $this->config->getComponentByType('GridState_Component');
|
||||||
|
|
||||||
|
if (!$state) {
|
||||||
$this->config->addComponent(new GridState_Component());
|
$this->config->addComponent(new GridState_Component());
|
||||||
|
}
|
||||||
|
|
||||||
$this->state = new GridState($this);
|
$this->state = new GridState($this);
|
||||||
|
|
||||||
$this->addExtraClass('ss-gridfield');
|
$this->addExtraClass('ss-gridfield');
|
||||||
|
Loading…
Reference in New Issue
Block a user