mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-03-18 15:39:53 +00:00
Adding fix for Ticket #2635, fixes Association data not correct if data is changed in afterFind()
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5303 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
d15f210546
commit
02d6c55d9f
2 changed files with 33 additions and 32 deletions
|
@ -857,10 +857,11 @@ class DboSource extends DataSource {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($mergeAssocTmp == $dataAssocTmp) {
|
if(array_keys($merge[0]) === array_keys($data)) {
|
||||||
$data[$association] = array_merge($merge[0][$association], $data[$association]);
|
|
||||||
} else {
|
|
||||||
$data[$association][$association] = $merge[0][$association];
|
$data[$association][$association] = $merge[0][$association];
|
||||||
|
} else {
|
||||||
|
$diff = Set::diff($dataAssocTmp, $mergeAssocTmp);
|
||||||
|
$data[$association] = array_merge($merge[0][$association], $diff);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue