mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-07-05 19:09:27 +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->config->addComponent(new GridState_Component());
|
||||
$state = $this->config->getComponentByType('GridState_Component');
|
||||
|
||||
if (!$state) {
|
||||
$this->config->addComponent(new GridState_Component());
|
||||
}
|
||||
|
||||
$this->state = new GridState($this);
|
||||
|
||||
$this->addExtraClass('ss-gridfield');
|
||||
|
|
Loading…
Reference in New Issue
Block a user