Browse Source

Joins are an integral parat of a query, keeping them for count operations

Fixes #4511
Jose Lorenzo Rodriguez 11 years ago
parent
commit
be67ce819b
2 changed files with 1 additions and 1 deletions
  1. 1 0
      src/ORM/Association/SelectableAssociationTrait.php
  2. 0 1
      src/ORM/Query.php

+ 1 - 0
src/ORM/Association/SelectableAssociationTrait.php

@@ -160,6 +160,7 @@ trait SelectableAssociationTrait {
  */
 	protected function _buildSubquery($query) {
 		$filterQuery = $query->cleanCopy();
+		$filterQuery->contain([], true);
 
 		$joins = $filterQuery->join();
 		foreach ($joins as $i => $join) {

+ 0 - 1
src/ORM/Query.php

@@ -492,7 +492,6 @@ class Query extends DatabaseQuery implements JsonSerializable {
 		$query->offset(null);
 		$query->mapReduce(null, null, true);
 		$query->formatResults(null, true);
-		$query->contain([], true);
 		return $query;
 	}