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:
phpnut 2007-06-20 01:37:23 +00:00
parent d15f210546
commit 02d6c55d9f
2 changed files with 33 additions and 32 deletions

View file

@ -857,10 +857,11 @@ class DboSource extends DataSource {
}
}
if ($mergeAssocTmp == $dataAssocTmp) {
$data[$association] = array_merge($merge[0][$association], $data[$association]);
} else {
if(array_keys($merge[0]) === array_keys($data)) {
$data[$association][$association] = $merge[0][$association];
} else {
$diff = Set::diff($dataAssocTmp, $mergeAssocTmp);
$data[$association] = array_merge($merge[0][$association], $diff);
}
}
}