Skip to content

Commit

Permalink
Joins are an integral parat of a query, keeping them for count operat…
Browse files Browse the repository at this point in the history
…ions

Fixes #4511
  • Loading branch information
lorenzo committed Sep 6, 2014
1 parent 7458089 commit be67ce8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 1 addition & 0 deletions src/ORM/Association/SelectableAssociationTrait.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ protected abstract function _linkField($options);
*/ */
protected function _buildSubquery($query) { protected function _buildSubquery($query) {
$filterQuery = $query->cleanCopy(); $filterQuery = $query->cleanCopy();
$filterQuery->contain([], true);


$joins = $filterQuery->join(); $joins = $filterQuery->join();
foreach ($joins as $i => $join) { foreach ($joins as $i => $join) {
Expand Down
1 change: 0 additions & 1 deletion src/ORM/Query.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -492,7 +492,6 @@ public function cleanCopy() {
$query->offset(null); $query->offset(null);
$query->mapReduce(null, null, true); $query->mapReduce(null, null, true);
$query->formatResults(null, true); $query->formatResults(null, true);
$query->contain([], true);
return $query; return $query;
} }


Expand Down

0 comments on commit be67ce8

Please sign in to comment.