mirror of
https://github.com/silverstripe/silverstripe-widgets
synced 2024-10-22 17:05:54 +02:00
Merge pull request #73 from webbuilders-group/master
Proposed fix for issue #25
This commit is contained in:
commit
8ee406675e
@ -251,6 +251,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.
|
||||
|
Loading…
Reference in New Issue
Block a user