From cc35b218e1c51a855a6361ab46e9c7d954276418 Mon Sep 17 00:00:00 2001 From: nate Date: Wed, 14 Jun 2006 23:55:17 +0000 Subject: [PATCH] Adding fix for Ticket #992 git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@3100 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/libs/model/datasources/dbo_source.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cake/libs/model/datasources/dbo_source.php b/cake/libs/model/datasources/dbo_source.php index a6abbc2e8..4f9e1e39a 100644 --- a/cake/libs/model/datasources/dbo_source.php +++ b/cake/libs/model/datasources/dbo_source.php @@ -628,7 +628,12 @@ class DboSource extends DataSource { if ($deepModel->name != $model->name) { $tmpStack = $stack; $tmpStack[] = $assoc1; - $this->queryAssociation($linkModel, $deepModel, $type1, $assoc1, $assocData1, $queryData, true, $fetch, $recursive - 1, $tmpStack); + if ($linkModel->useDbConfig == $deepModel->useDbConfig) { + $db =& $this; + } else { + $db =& ConnectionManager::getDataSource($deepModel->useDbConfig); + } + $db->queryAssociation($linkModel, $deepModel, $type1, $assoc1, $assocData1, $queryData, true, $fetch, $recursive - 1, $tmpStack); } } }