From 3a226b03c3ca5ea255d2e1ec22bb9bd51fc13ea8 Mon Sep 17 00:00:00 2001 From: mark_story Date: Wed, 12 Mar 2014 23:42:21 -0400 Subject: [PATCH] Remove typehint from generateAssociationQuery() While I think typehints are generally a good idea, this one broke a few plugins, notably CakeDC/search. I don't think it is wise for 2.X release to break BC in that way. I think reverting this change is probably the safest path right now. --- lib/Cake/Model/Datasource/DboSource.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/Cake/Model/Datasource/DboSource.php b/lib/Cake/Model/Datasource/DboSource.php index 4be0d74d2..a7ce76d35 100644 --- a/lib/Cake/Model/Datasource/DboSource.php +++ b/lib/Cake/Model/Datasource/DboSource.php @@ -1644,6 +1644,10 @@ class DboSource extends DataSource { public function generateAssociationQuery(Model $Model, $LinkModel, $type, $association, $assocData, &$queryData, $external) { $assocData = $this->_scrubQueryData($assocData); + if ($LinkModel === null) { + return ''; + } + if ($external && !empty($assocData['finderQuery'])) { return $assocData['finderQuery']; }