Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Commit

Permalink
Merge branch 'hotfix/4180'
Browse files Browse the repository at this point in the history
Close #4180
Fixes #4136
  • Loading branch information
weierophinney committed Apr 15, 2013
2 parents 49b82fd + 899c1a1 commit a3c3297
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions library/Zend/Form/View/Helper/FormMultiCheckbox.php
Expand Up @@ -257,10 +257,10 @@ protected function renderOptions(MultiCheckboxElement $element, array $options,

$value = '';
$label = '';
$selected = false;
$disabled = false;
$inputAttributes = $attributes;
$labelAttributes = $globalLabelAttributes;
$selected = isset($inputAttributes['selected']) && $inputAttributes['type'] != 'radio' && $inputAttributes['selected'] != false ? true : false;
$disabled = isset($inputAttributes['disabled']) && $inputAttributes['disabled'] != false ? true : false;

if (is_scalar($optionSpec)) {
$optionSpec = array(
Expand Down
8 changes: 8 additions & 0 deletions tests/ZendTest/Form/View/Helper/FormMultiCheckboxTest.php
Expand Up @@ -364,4 +364,12 @@ public function testGetUncheckedValueSetToFoo()
$uncheckedValue = $this->helper->getUncheckedValue();
$this->assertSame('foo', $uncheckedValue);
}

public function testGetDisableAttributeReturnTrue()
{
$element = new MultiCheckboxElement('foo');
$element->setAttribute('disabled', 'true' );
$this->assertSame('true', $element->getAttribute('disabled'));
}

}

0 comments on commit a3c3297

Please sign in to comment.