mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-07 20:12:42 +00:00
Found the bug and fixed it, closes #4693
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6977 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
e1e71b6d93
commit
1224845967
2 changed files with 14 additions and 13 deletions
|
@ -265,10 +265,12 @@ class ContainableBehavior extends ModelBehavior {
|
|||
$children[$key] = (array)$val;
|
||||
}
|
||||
}
|
||||
|
||||
$keys = array_keys($children);
|
||||
if ($keys && isset($children[0])) {
|
||||
$keys = array_values($children);
|
||||
$keys = am(array_values($children), $keys);
|
||||
}
|
||||
|
||||
foreach ($keys as $i => $key) {
|
||||
if (is_array($key)) {
|
||||
continue;
|
||||
|
@ -291,7 +293,7 @@ class ContainableBehavior extends ModelBehavior {
|
|||
$key = $option;
|
||||
$optionKey = true;
|
||||
}
|
||||
if ($optionKey) {
|
||||
if ($optionKey && isset($children[$key])) {
|
||||
$keep[$name][$key] = array_merge((isset($keep[$name][$key]) ? $keep[$name][$key] : array()), (array) $children[$key]);
|
||||
unset($children[$key]);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue