I have identified an issue where the order of attributes in the configuration array for a checkbox element affects whether it is rendered as checked or unchecked. This behavior is unexpected because the order of attributes in the array should not matter.
The following code works as expected, rendering the checkbox as checked:
$checkbox = $this->createElement(
'checkbox',
'checkbox-xy',
[
'class' => 'autosubmit',
'checkedValue' => 'a',
'uncheckedValue' => 'b',
'value' => 'a',
]
);
However, the following code renders the checkbox as unchecked, even though it should be checked:
$checkbox = $this->createElement(
'checkbox',
'checkbox-xy',
[
'class' => 'autosubmit',
'value' => 'a',
'checkedValue' => 'a',
'uncheckedValue' => 'b',
]
);
I have identified an issue where the order of attributes in the configuration array for a checkbox element affects whether it is rendered as checked or unchecked. This behavior is unexpected because the order of attributes in the array should not matter.
The following code works as expected, rendering the checkbox as checked:
However, the following code renders the checkbox as unchecked, even though it should be checked: