Skip to content

Commit

Permalink
Merge pull request #4778 from assertchris/prevent-multiple-states-add…
Browse files Browse the repository at this point in the history
…ed-to-single-config

Preventing multiple states added to single config
  • Loading branch information
Damian Mooyman committed Nov 17, 2015
2 parents 1dfa2dc + b897572 commit 37957b7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion forms/gridfield/GridField.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,12 @@ public function __construct($name, $title = null, SS_List $dataList = null, Grid

$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');
Expand Down

0 comments on commit 37957b7

Please sign in to comment.