Browse Source

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.
mark_story 12 years ago
parent
commit
3a226b03c3
1 changed files with 4 additions and 0 deletions
  1. 4 0
      lib/Cake/Model/Datasource/DboSource.php

+ 4 - 0
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'];
 		}