Skip to content
Permalink
Browse files

BC fixes for habtm. Closes #3545.

Signed-off-by: Rachman Chavik <rchavik@xintesa.com>
  • Loading branch information...
dereuromark authored and rchavik committed Jan 30, 2013
1 parent 0a96e20 commit d504642c9b0a64e3bb92e29698da6abce570ffa2
Showing with 3 additions and 2 deletions.
  1. +1 −1 lib/Cake/Test/Case/View/Helper/FormHelperTest.php
  2. +2 −1 lib/Cake/View/Helper/FormHelper.php
@@ -4056,7 +4056,7 @@ public function testHabtmSelectBox() {
'Contact' => array(),
'ContactTag' => array(
array(
'id' => 1,
'id' => '1',
'name' => 'blue'
),
array(
@@ -2475,9 +2475,10 @@ protected function _selectOptions($elements = array(), $parents = array(), $show
}
if ($name !== null) {
$isNumeric = is_numeric($name);
if (
(!$selectedIsArray && !$selectedIsEmpty && (string)$attributes['value'] == (string)$name) ||
($selectedIsArray && in_array($name, $attributes['value'], true))
($selectedIsArray && in_array($name, $attributes['value'], !$isNumeric))
) {
if ($attributes['style'] === 'checkbox') {
$htmlOptions['checked'] = true;

0 comments on commit d504642

Please sign in to comment.
You can’t perform that action at this time.