You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
That is the content of "checkbox_widget.html.php". It is easy to see, that the value is only rendered if($value). Since "0" == true => false, the index 0 is not possible in checkboxes. As i think "0" is a reasonable value and therefore expected to work, this should be changed. Could be
if ($value || '0' === $value)
Something better does not get in my mind, yet.
If you try to use a "choice" like in the choice type (and expanded = true)
[
0 => 'a',
1 => 'b',
2 => 'c'
]
checking "a" won't be recognized and checking "b" will end in an cryptic error.
The text was updated successfully, but these errors were encountered:
…mplates (jakzal)
This PR was merged into the 2.3 branch.
Discussion
----------
[FrameworkBundle] Allowed "0" as a checkbox value in php templates
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #8251
| License | MIT
| Doc PR |
Commits
-------
955e8cf [FrameworkBundle] Allowed "0" as a checkbox value in the php template.
That is the content of "checkbox_widget.html.php". It is easy to see, that the value is only rendered if($value). Since "0" == true => false, the index 0 is not possible in checkboxes. As i think "0" is a reasonable value and therefore expected to work, this should be changed. Could be
Something better does not get in my mind, yet.
If you try to use a "choice" like in the choice type (and expanded = true)
checking "a" won't be recognized and checking "b" will end in an cryptic error.
The text was updated successfully, but these errors were encountered: