From 3246cf7c1ee995821946704eda5889741550d5cd Mon Sep 17 00:00:00 2001 From: dogmatic69 Date: Thu, 16 Feb 2012 16:22:45 +0000 Subject: [PATCH] adding the model alias so that there are no issues when the find has a join on it --- lib/Cake/Model/Model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Cake/Model/Model.php b/lib/Cake/Model/Model.php index db1d460cc..5a0b9a820 100644 --- a/lib/Cake/Model/Model.php +++ b/lib/Cake/Model/Model.php @@ -1945,7 +1945,7 @@ class Model extends Object implements CakeEventListener { return array(); } $old = $this->find('first', array( - 'conditions' => array($this->primaryKey => $this->id), + 'conditions' => array($this->alias . '.' . $this->primaryKey => $this->id), 'fields' => array_values($included), 'recursive' => -1 ));