From 745934e5151e7bcc828d973ff6b039335c27c942 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Sun, 5 Dec 2021 22:18:07 -0500 Subject: [PATCH] SearchKit - Fix undefined variable for searches of Afforms and other non-DAO entities --- ext/search_kit/ang/crmSearchAdmin/crmSearchAdmin.component.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/search_kit/ang/crmSearchAdmin/crmSearchAdmin.component.js b/ext/search_kit/ang/crmSearchAdmin/crmSearchAdmin.component.js index d0b8750bc3..f94bd17440 100644 --- a/ext/search_kit/ang/crmSearchAdmin/crmSearchAdmin.component.js +++ b/ext/search_kit/ang/crmSearchAdmin/crmSearchAdmin.component.js @@ -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'}) || {}; -- 2.25.1