CRM-15417 - fix getfields output
authorColeman Watts <coleman@civicrm.org>
Mon, 13 Oct 2014 19:17:53 +0000 (15:17 -0400)
committerColeman Watts <coleman@civicrm.org>
Mon, 13 Oct 2014 22:08:55 +0000 (18:08 -0400)
api/v3/MailingGroup.php
templates/CRM/Admin/Page/APIExplorer.js

index 490a793649977ea20a54e6d7042ca4abf32cdfdd..a75b5323b3856d5df77a5ae87a8e2f651cc6b830 100644 (file)
@@ -116,6 +116,6 @@ function civicrm_api3_mailing_group_getfields($params) {
     unset($field['pseudoconstant']);
   }
 
-  return civicrm_api3_create_success($fields, $params, 'mailing_group');
+  return civicrm_api3_create_success($fields, $params, 'mailing_group', 'getfields');
 }
 
index d76826a7edc5ddb2101aa6c2fc1c7dfef018396d..4455c960e083ed1ba26d40e9734d711ee1e8062e 100644 (file)
         id: 'api_action',
         text: 'Action'
       });
-      options.api_action = _.transform(actions, function(ret, item) {ret.push({value: item, key: item})});
+      options.api_action = _.reduce(actions.values, function(ret, item) {
+        ret[item] = item;
+        return ret;
+      }, {});
       showFields(['api_action']);
       return;
     }