Skip to content

Commit

Permalink
Merge branch 'release/4.0.8'
Browse files Browse the repository at this point in the history
  • Loading branch information
rhukster committed Apr 30, 2020
2 parents ccb75fd + bed3e7e commit 6304a48
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# v4.0.8
## 04/30/2020

1. [](#bugfix)
* Fixed issue with `force_bool` in `toggle` field to be more robust

# v4.0.7
## 04/27/2020

Expand Down
2 changes: 1 addition & 1 deletion blueprints.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Form
slug: form
type: plugin
version: 4.0.7
version: 4.0.8
testing: false
description: Enables the forms handling
icon: check-square
Expand Down
5 changes: 3 additions & 2 deletions templates/forms/fields/toggle/toggle.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@
{% block input %}
{% set value = (value is same as(false) ? 0 : value) %}

{% if field.force_bool %}
{% set value = value|bool %}
{% if field.force_bool and get_type(value) == 'string'%}
{% set value = true %}
{% endif %}


<div class="switch-toggle switch-grav {{ field.size }} switch-{{ field.options|length }} {{ field.classes }}">
{% set maxLen = 0 %}
{% for text in field.options %}
Expand Down

0 comments on commit 6304a48

Please sign in to comment.