From b7d8183bf6fffcfb5ca531764215d664d1968953 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Fri, 23 Jul 2021 13:01:41 -0400 Subject: [PATCH] SearchKit - Use primary_key metadata instead of hard-coded string "id" --- .../ang/crmSearchAdmin/crmSearchAdmin.component.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ext/search_kit/ang/crmSearchAdmin/crmSearchAdmin.component.js b/ext/search_kit/ang/crmSearchAdmin/crmSearchAdmin.component.js index 0b3e361dc7..79ffe0ed4d 100644 --- a/ext/search_kit/ang/crmSearchAdmin/crmSearchAdmin.component.js +++ b/ext/search_kit/ang/crmSearchAdmin/crmSearchAdmin.component.js @@ -659,8 +659,9 @@ if (ctrl.savedSearch.api_params.groupBy.indexOf(info.path) > -1) { return false; } - // If the entity this column belongs to is being grouped by id, then also no - return ctrl.savedSearch.api_params.groupBy.indexOf(info.prefix + 'id') < 0; + // If the entity this column belongs to is being grouped by primary key, then also no + var idField = searchMeta.getEntity(info.field.entity).primary_key[0]; + return ctrl.savedSearch.api_params.groupBy.indexOf(info.prefix + idField) < 0; }; $scope.formatResult = function(row, col) { -- 2.25.1