Skip to content

Commit

Permalink
Unchecked Zend\Form\View\Helper\FormMultiCheckbox
Browse files Browse the repository at this point in the history
Checkbox is unchecked when option and value have various data types. I think that this behavior is wrong, because i usually get value from request as string and options are usually defined as int.

e.g.
$options = array(1 => 'test 1', 2 => 'test 2');
$request = array('1');
For this example, checkbox is unchecked.
  • Loading branch information
Karel Stefan committed Aug 23, 2012
1 parent cca558a commit 3de7f6d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/Zend/Form/View/Helper/FormMultiCheckbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ protected function renderOptions(ElementInterface $element, array $options, arra
$inputAttributes = array_merge($inputAttributes, $optionSpec['attributes']);
}

if (in_array($value, $selectedOptions, true)) {
if (in_array($value, $selectedOptions)) {
$selected = true;
}

Expand Down

0 comments on commit 3de7f6d

Please sign in to comment.