The selected 0 value is shown in both places
The selected 0 value is ignored in both places
This is an issue with how com_fields sets up the fields.
If I specify a checkboxes field in the form XML with the same options, it works fine. So it's not the JFormFieldCheckboxes that is buggy.
When debuging I saw that when the form is defined in the XML, the value in https://github.com/joomla/joomla-cms/blob/staging/libraries/joomla/form/fields/checkboxes.php#L153 is an array (even with only one option) and the $hasValue
passes. However if it is coming from com_fields, the value is a string if it's only one selected option and thus the check fails.
Now we could adjust the formfield to take care of strings as well, but I don't know the side effects as checkboxes are really a strange thing to handle.
I'd prefer to fix it in com_fields, but I haven't found yet where we could do it.
Also it may be related to the $forceMultiple
property that is set in the checkboxes field. Maybe com_fields need to read that one and act accordingly.
Labels |
Added:
?
|
Category | ⇒ | com_fields |
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-11-22 09:24:58 |
Closed_By | ⇒ | Bakual |
Added a callback to the field to prepare the value in #12886.