Fixed php notice

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@39821 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Andrew O'Neil 2007-08-10 02:20:47 +00:00
parent 858e877858
commit d93528100c

View File

@ -455,7 +455,7 @@ class Form extends ViewableData {
$dataFields = $this->fields->dataFields(); $dataFields = $this->fields->dataFields();
if($dataFields) foreach($dataFields as $field) { if($dataFields) foreach($dataFields as $field) {
$name = $field->Name(); $name = $field->Name();
$val = $o ? $object->$name : $object[$name]; $val = $o ? $object->$name : (isset($object[$name]) ? $object[$name] : null);
if($name && $val) $field->setValue($val); if($name && $val) $field->setValue($val);
} }
} }