Only set GridField state in request if a value is submitted

This commit is contained in:
Simon Welsh 2013-05-07 08:15:27 +12:00
parent b5a83878dd
commit 8930304dfc

View File

@ -670,7 +670,7 @@ class GridField extends FormField {
$this->setDataModel($model);
$fieldData = $this->request->requestVar($this->getName());
if($fieldData && $fieldData['GridState']) $this->getState(false)->setValue($fieldData['GridState']);
if($fieldData && isset($fieldData['GridState'])) $this->getState(false)->setValue($fieldData['GridState']);
foreach($this->getComponents() as $component) {
if(!($component instanceof GridField_URLHandler)) {