Permalink
Browse files

fixing testcases + do not disable the hidden input on partial disables

  • Loading branch information...
ptica committed Oct 25, 2014
1 parent abb0c7c commit 797635d26b49de2afc24d317944a7820af7c73fd
Showing with 3 additions and 3 deletions.
  1. +2 −2 lib/Cake/Test/Case/View/Helper/FormHelperTest.php
  2. +1 −1 lib/Cake/View/Helper/FormHelper.php
@@ -2695,7 +2695,7 @@ public function testInputCheckboxWithDisabledElements() {
array('label' => array('for' => "ContactMultiple")),
'Multiple',
'/label',
- array('input' => array('type' => 'hidden', 'name' => "data[Contact][multiple]", 'value' => '', 'id' => "ContactMultiple")),
+ array('input' => array('type' => 'hidden', 'name' => "data[Contact][multiple]", 'value' => '', 'id' => "ContactMultiple", 'disabled' => 'disabled')),
array('div' => array('class' => 'checkbox')),
array('input' => array('type' => 'checkbox', 'name' => "data[Contact][multiple][]", 'value' => 1, 'disabled' => 'disabled', 'id' => "ContactMultiple1")),
array('label' => array('for' => "ContactMultiple1")),
@@ -5004,7 +5004,7 @@ public function testSelectMultipleWithDisabledElements() {
'Multiple',
'/label',
'input' => array(
- 'type' => 'hidden', 'name' => 'data[Contact][multiple]', 'value' => '', 'id' => 'ContactMultiple_'
+ 'type' => 'hidden', 'name' => 'data[Contact][multiple]', 'value' => '', 'id' => 'ContactMultiple_', 'disabled' => 'disabled'
),
'select' => array(
'name' => 'data[Contact][multiple][]', 'disabled' => 'disabled', 'multiple' => 'multiple', 'id' => 'ContactMultiple'
@@ -2070,7 +2070,7 @@ public function select($fieldName, $options = array(), $attributes = array()) {
'secure' => false,
'form' => isset($attributes['form']) ? $attributes['form'] : null,
'name' => $attributes['name'],
- 'disabled' => $attributes['disabled']
+ 'disabled' => $attributes['disabled'] === true || $attributes['disabled'] === 'disabled'
);
$select[] = $this->hidden(null, $hiddenAttributes);
}

0 comments on commit 797635d

Please sign in to comment.