Skip to content

Commit 158e8d1

Browse files
authored
Fix "GROUP BY" builder ignoring parameters (#413)
1 parent 9090a84 commit 158e8d1

2 files changed

Lines changed: 2 additions & 12 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## 2.0.1 under development
44

5-
- no changes in this release.
5+
- Bug #413: Fix "GROUP BY" builder ignoring parameters (@vjik)
66

77
## 2.0.0 December 05, 2025
88

src/DQLQueryBuilder.php

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function build(QueryInterface $query, array $params = []): array
4545
$this->buildFrom($query->getFrom(), $params),
4646
$this->buildJoin($query->getJoins(), $params),
4747
$this->buildWhere($query->getWhere(), $params),
48-
$this->buildGroupBy($query->getGroupBy()),
48+
$this->buildGroupBy($query->getGroupBy(), $params),
4949
$this->buildHaving($query->getHaving(), $params),
5050
$this->buildFor($query->getFor()),
5151
];
@@ -62,16 +62,6 @@ public function build(QueryInterface $query, array $params = []): array
6262
}
6363
}
6464

65-
$groupBy = $query->getGroupBy();
66-
67-
if (!empty($groupBy)) {
68-
foreach ($groupBy as $expression) {
69-
if ($expression instanceof ExpressionInterface) {
70-
$this->buildExpression($expression, $params);
71-
}
72-
}
73-
}
74-
7565
$union = $this->buildUnion($query->getUnions(), $params);
7666

7767
if ($union !== '') {

0 commit comments

Comments
 (0)