diff --git a/CHANGELOG.md b/CHANGELOG.md index cf97cbdb..323096ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +# v4.0.2 +## 02/03/2020 + +1. [](#improved) + * Allow checkbox field to have custom value, default to 1 +1. [](#bugfix) + * Fixed `toggle` field not working with `toggleable: true` + * Fixed fatal error when form type is disabled + # v4.0.1 ## 01/02/2020 diff --git a/blueprints.yaml b/blueprints.yaml index 76988b8e..adc287de 100644 --- a/blueprints.yaml +++ b/blueprints.yaml @@ -1,5 +1,5 @@ name: Form -version: 4.0.1 +version: 4.0.2 testing: false description: Enables the forms handling icon: check-square diff --git a/form.php b/form.php index dbc324a4..940f9009 100644 --- a/form.php +++ b/form.php @@ -712,10 +712,14 @@ public function onFormValidationError(Event $event) * Add a form to the forms plugin * * @param string|null $page_route - * @param FormInterface $form + * @param FormInterface|null $form */ - public function addForm(?string $page_route, FormInterface $form) + public function addForm(?string $page_route, ?FormInterface $form) { + if (null === $form) { + return; + } + $name = $form->getName(); if (!isset($this->forms[$page_route][$name])) { diff --git a/templates/forms/fields/checkbox/checkbox.html.twig b/templates/forms/fields/checkbox/checkbox.html.twig index c458e979..83c44601 100644 --- a/templates/forms/fields/checkbox/checkbox.html.twig +++ b/templates/forms/fields/checkbox/checkbox.html.twig @@ -9,9 +9,9 @@ {% set maxLen = 0 %}