Skip to content

Commit

Permalink
Merge pull request #22218 from colemanw/fixCanAggregate
Browse files Browse the repository at this point in the history
SearchKit - Fix undefined variable for searches of Afforms etc.
  • Loading branch information
demeritcowboy authored Dec 7, 2021
2 parents c7d076b + 745934e commit 567bfce
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@
// Is a column eligible to use an aggregate function?
this.canAggregate = function(col) {
// If the query does not use grouping, never
if (!ctrl.savedSearch.api_params.groupBy.length) {
if (!ctrl.savedSearch.api_params.groupBy || !ctrl.savedSearch.api_params.groupBy.length) {
return false;
}
var arg = _.findWhere(searchMeta.parseExpr(col).args, {type: 'field'}) || {};
Expand Down

0 comments on commit 567bfce

Please sign in to comment.