Actions
Bug #72235
closedChecked attribute not workling in Fluids' CheckboxViewHelper for non property values
Start date:
2015-12-15
Due date:
% Done:
0%
Estimated time:
TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:
Description
In case one wants to use the "checked" attribute of fluids CheckboxViewHelper via a condition or just by setting it to "true" it does not work.
Example:
<f:form.checkbox name="data[mykey]" value="1" checked="{data.key} 1" />
This is caused by a wrong check in the CheckboxViewHelper on line 112-114 as there's always a string passed to the viewhelper
if ($checked = true) {
$this->tag->addAttribute('checked', 'checked');
}
To solve this problem a typecast on "$checked" needs to be made.
if ((boolean)$checked === true) {
$this->tag->addAttribute('checked', 'checked');
}
Actions