mirror of
https://github.com/silverstripe/silverstripe-widgets
synced 2024-10-22 17:05:54 +02:00
Proposed fix for issue #25
This commit is contained in:
parent
6b67ee0ff8
commit
025604971c
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user