Skip to content

Commit

Permalink
Fix count query detection, the select array may not be zero based
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastian-lenz committed Jun 14, 2019
1 parent 7f15499 commit fc6bbf0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/foreignField/ForeignFieldQueryExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ static private function enableJoin(ElementQuery $query, ForeignField $field) {
static public function isCountQuery(ElementQuery $query) {
return (
count($query->select) == 1 &&
$query->select[0] == 'COUNT(*)'
reset($query->select) == 'COUNT(*)'
);
}
}

0 comments on commit fc6bbf0

Please sign in to comment.