Bug #72235
closedChecked attribute not workling in Fluids' CheckboxViewHelper for non property values
0%
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');
}
Updated by Mathias Brodala almost 9 years ago
Maybe related to #67225 which was fixed recently?
Updated by Gerrit Code Review almost 9 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/45289
Updated by Mathias Schreiber almost 9 years ago
- Status changed from Under Review to Closed
abandoned due to user request