From e3711a13533a6d319ea04d32f403ec3c2921132b Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Sat, 17 Dec 2022 18:02:15 -0500 Subject: [PATCH] SearchKit - Fix option loading & rendering for in-place edit Fixes dev/core#4037 --- ext/search_kit/ang/crmSearchAdmin.module.js | 5 ++++- .../crmSearchInput/crmSearchInputVal.component.js | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ext/search_kit/ang/crmSearchAdmin.module.js b/ext/search_kit/ang/crmSearchAdmin.module.js index 88f3ec77c5..54d3322809 100644 --- a/ext/search_kit/ang/crmSearchAdmin.module.js +++ b/ext/search_kit/ang/crmSearchAdmin.module.js @@ -411,7 +411,10 @@ _.each(results, function(fields, entityName) { var entity = getEntity(entityName); _.each(fields, function(options, fieldName) { - _.find(entity.fields, {name: fieldName}).options = options; + var field = _.find(entity.fields, {name: fieldName}); + if (field) { + field.options = options; + } }); entity.optionsLoaded = true; }); diff --git a/ext/search_kit/ang/crmSearchTasks/crmSearchInput/crmSearchInputVal.component.js b/ext/search_kit/ang/crmSearchTasks/crmSearchInput/crmSearchInputVal.component.js index f55cce68d4..0168ba0d20 100644 --- a/ext/search_kit/ang/crmSearchTasks/crmSearchInput/crmSearchInputVal.component.js +++ b/ext/search_kit/ang/crmSearchTasks/crmSearchInput/crmSearchInputVal.component.js @@ -144,7 +144,7 @@ if (!_.includes(['>', '<', '>=', '<='], ctrl.op)) { // Only use option list if the field has a "name" suffix - if (field.options && field.suffixes && field.suffixes.includes('name')) { + if (field.options && (!field.suffixes || field.suffixes.includes('name'))) { return '~/crmSearchTasks/crmSearchInput/select.html'; } if (field.fk_entity || field.name === 'id') { -- 2.25.1