From 5bd06c360595f8e8dd5eda5b3df312969cdf5664 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Sat, 14 Mar 2015 23:04:45 -0400 Subject: [PATCH] Api explorer - limit multiselect to certain actions --- templates/CRM/Admin/Page/APIExplorer.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/templates/CRM/Admin/Page/APIExplorer.js b/templates/CRM/Admin/Page/APIExplorer.js index 4f311128b3..8c7a666a31 100644 --- a/templates/CRM/Admin/Page/APIExplorer.js +++ b/templates/CRM/Admin/Page/APIExplorer.js @@ -23,6 +23,9 @@ // Actions that don't support fancy operators NO_OPERATORS = ['create', 'update', 'delete', 'setvalue', 'getoptions', 'getactions', 'getfields'], + // Actions that don't support multiple values + NO_MULTI = ['delete', 'getoptions', 'getactions', 'getfields'], + // Operators with special properties BOOL = ['IS NULL', 'IS NOT NULL'], TEXT = ['LIKE', 'NOT LIKE'], @@ -266,7 +269,7 @@ * @returns boolean */ function isMultiSelect(fieldName, operator) { - if (isYesNo(fieldName)) { + if (isYesNo(fieldName) || _.includes(NO_MULTI, action)) { return false; } if (_.includes(MULTI, operator)) { -- 2.25.1