Skip to content

Commit 466f3a5

Browse files
Fix stale aggregate/group_value sort when group by is disabled
When sortBy was set to 'aggregate' or 'group_value' from a previous group by session, disabling group by would pass the stale sort column to the base query causing a column not found error. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 907d2ae commit 466f3a5

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/ReportBuilder.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ public function rowsQuery()
2525
$query = parent::rowsQuery();
2626

2727
if (! $this->hasGroupBy()) {
28+
if (in_array($this->sortBy, ['aggregate', 'group_value'], true)) {
29+
$this->sortBy = '';
30+
$query->reorder();
31+
}
32+
2833
return $query;
2934
}
3035

0 commit comments

Comments
 (0)