concrete5/concrete5 — pull request #493 by magnusbengtsson (2012-04-14 06:33:47+00:00)
Title: Updates to the "Task Permissions" screen

On the "Task Permissions" screen the "No" radio button is always checked even if the groups has the rights to perform a task (in this case both the "Yes" and the "No" has the checked attribute set).

The reason for this is that if the $canRead is false, $canRead would be equal to 0 which means that the $form->radio function would set the checked attribute.

The current code contains the following error:
The $canRead should not be passed to both the rendering of the "Yes" and "No" radio button.
If !($canRead) would be passed to the "No" rendering the "checked" attribute would always be set since it is either true (if $canRead is false) or !($canRead) would be equal to 0.

The proposed solution would be to pass in 'true' or '' to the $form->radio function.

Note, that it is not required to change the behavior of the "Yes" rendering both for consistency and readability I have changed both.