Proposed fix for issue #25

This commit is contained in:
UndefinedOffset 2014-06-17 15:33:02 -03:00
parent 6b67ee0ff8
commit 025604971c

View File

@ -240,6 +240,14 @@ class Widget extends DataObject {
}
}
//Look for checkbox fields not present in the data
foreach($fields as $field) {
if($field instanceof CheckboxField && !array_key_exists($field->getName(), $data)) {
$field->setValue(false);
$field->saveInto($this);
}
}
$this->write();
// The field must be written to ensure a unique ID.