From 4f3a95d94f34caba5cad15c34d1638d32a8d9ef5 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Fri, 2 Oct 2020 20:44:43 -0400 Subject: [PATCH] Search ext: Fix column appearing in the aggregate list when it is used in GROUP_BY The bug was that it wasn't recognizing the column name after a function was added to it. --- ext/search/ang/search/crmSearch.component.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/search/ang/search/crmSearch.component.js b/ext/search/ang/search/crmSearch.component.js index cda1af0d57..9da0ffe8fa 100644 --- a/ext/search/ang/search/crmSearch.component.js +++ b/ext/search/ang/search/crmSearch.component.js @@ -343,12 +343,12 @@ // Is a column eligible to use an aggregate function? this.canAggregate = function(col) { + var info = searchMeta.parseExpr(col); // If the column is used for a groupBy, no - if (ctrl.params.groupBy.indexOf(col) > -1) { + if (ctrl.params.groupBy.indexOf(info.path) > -1) { return false; } // If the entity this column belongs to is being grouped by id, then also no - var info = searchMeta.parseExpr(col); return ctrl.params.groupBy.indexOf(info.prefix + 'id') < 0; }; -- 2.25.1