Skip to content

Commit

Permalink
SearchKit - Fix removing all related fields from SELECT when removing…
Browse files Browse the repository at this point in the history
… a JOIN
  • Loading branch information
colemanw committed Mar 7, 2021
1 parent 5747164 commit 133f6a1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ext/search/ang/crmSearchAdmin/crmSearchAdmin.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,8 @@
var alias = searchMeta.getJoin(ctrl.savedSearch.api_params.join[index][0]).alias;
ctrl.clearParam('join', index);
_.remove(ctrl.savedSearch.api_params.select, function(item) {
return item.indexOf(alias + '.') === 0;
var pattern = new RegExp('\\b' + alias + '\\.');
return pattern.test(item.split(' AS ')[0]);
});
_.remove(ctrl.savedSearch.api_params.where, function(clause) {
return clauseUsesJoin(clause, alias);
Expand Down

0 comments on commit 133f6a1

Please sign in to comment.