diff --git a/src/View/Helper/FormHelper.php b/src/View/Helper/FormHelper.php index aa0795697c3..9b1a643fc59 100644 --- a/src/View/Helper/FormHelper.php +++ b/src/View/Helper/FormHelper.php @@ -1288,7 +1288,7 @@ protected function _magicOptions($fieldName, $options, $allowOverride) if ($allowOverride && substr($fieldName, -5) === '._ids') { $options['type'] = 'select'; - if ( (!isset($options['multiple']) || ($options['multiple'] && $options['multiple'] != 'checkbox')) ) { + if ((!isset($options['multiple']) || ($options['multiple'] && $options['multiple'] != 'checkbox'))) { $options['multiple'] = true; } } diff --git a/tests/TestCase/View/Helper/FormHelperTest.php b/tests/TestCase/View/Helper/FormHelperTest.php index 47577440a5b..a953937bffb 100644 --- a/tests/TestCase/View/Helper/FormHelperTest.php +++ b/tests/TestCase/View/Helper/FormHelperTest.php @@ -5033,6 +5033,13 @@ public function testSelectMultiple() ['multiple' => 'multiple', 'form' => 'my-form'] ); $this->assertHtml($expected, $result); + + $result = $this->Form->select( + 'Model.multi_field', + $options, + ['form' => 'my-form', 'multiple' => false] + ); + $this->assertNotContains('multiple', $result); } /**