Api explorer - limit multiselect to certain actions
authorColeman Watts <coleman@civicrm.org>
Sun, 15 Mar 2015 03:04:45 +0000 (23:04 -0400)
committerColeman Watts <coleman@civicrm.org>
Sun, 15 Mar 2015 03:04:45 +0000 (23:04 -0400)
templates/CRM/Admin/Page/APIExplorer.js

index 4f311128b3fb734b6820edff8ead5f40c83bb884..8c7a666a318e314333782cf35859c3c2180f73be 100644 (file)
@@ -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'],
    * @returns boolean
    */
   function isMultiSelect(fieldName, operator) {
-    if (isYesNo(fieldName)) {
+    if (isYesNo(fieldName) || _.includes(NO_MULTI, action)) {
       return false;
     }
     if (_.includes(MULTI, operator)) {