mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
BC fixes for habtm. Closes #3545.
Signed-off-by: Rachman Chavik <rchavik@xintesa.com>
This commit is contained in:
parent
0a96e200a6
commit
d504642c9b
2 changed files with 3 additions and 2 deletions
|
@ -4056,7 +4056,7 @@ class FormHelperTest extends CakeTestCase {
|
|||
'Contact' => array(),
|
||||
'ContactTag' => array(
|
||||
array(
|
||||
'id' => 1,
|
||||
'id' => '1',
|
||||
'name' => 'blue'
|
||||
),
|
||||
array(
|
||||
|
|
|
@ -2475,9 +2475,10 @@ class FormHelper extends AppHelper {
|
|||
}
|
||||
|
||||
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;
|
||||
|
|
Loading…
Reference in a new issue