diff --git a/classes/Form.php b/classes/Form.php index dad2974b..51a689c6 100644 --- a/classes/Form.php +++ b/classes/Form.php @@ -870,6 +870,9 @@ public function post() if ($field['type'] === 'checkbox' || $field['type'] === 'switch') { $data[$name] = isset($data[$name]) ? true : false; } + if ($field['type'] === 'checkboxes' && !isset($data[$name])) { + $data[$name] = []; + } $i++; } diff --git a/templates/forms/fields/checkboxes/checkboxes.html.twig b/templates/forms/fields/checkboxes/checkboxes.html.twig index ba9a6506..60597ebd 100644 --- a/templates/forms/fields/checkboxes/checkboxes.html.twig +++ b/templates/forms/fields/checkboxes/checkboxes.html.twig @@ -1,10 +1,6 @@ {% extends "forms/field.html.twig" %} {% set originalValue = value %} -{% set value = (value is null ? field.default : value) %} -{% if field.use == 'keys' and field.default %} - {% set value = field.default|merge(value) %} -{% endif %} {% block global_attributes %} {{ parent() }}