Fixing error when using associations with recursive level deeper then 1

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@3474 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2006-09-14 02:47:11 +00:00
parent 10ad71b30c
commit 27fc6bced9

View file

@ -401,8 +401,8 @@ class DataSource extends Object{
} else { } else {
$found = false; $found = false;
foreach (array_reverse($stack) as $assoc) { foreach (array_reverse($stack) as $assoc) {
if (isset($data[$assoc]) && isset($data[$assoc][$model->primaryKey])) { if (isset($data[$assoc]) && isset($data[$assoc][$foreignKey])) {
$val = $data[$assoc][$model->primaryKey]; $val = $data[$assoc][$foreignKey];
$found = true; $found = true;
break; break;
} }