diff --git a/ext/search_kit/ang/crmSearchAdmin.module.js b/ext/search_kit/ang/crmSearchAdmin.module.js index 88f3ec77c500..54d332280984 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 f55cce68d4bb..0168ba0d2085 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') {