API Explorer - fix metadata lookup problem caused by unique names
authorColeman Watts <coleman@civicrm.org>
Tue, 24 Mar 2015 02:21:07 +0000 (22:21 -0400)
committerColeman Watts <coleman@civicrm.org>
Tue, 24 Mar 2015 02:28:29 +0000 (22:28 -0400)
templates/CRM/Admin/Page/APIExplorer.js

index b28273168b36d438982a5b8d58a7e4603b476e98..1b50cb1fbdcfe203e38a9d78c4dc1701ba8b9a7c 100644 (file)
   function getFields(changedElement) {
     var required = [];
     fields = [];
-    options = getFieldData = {};
+    options = {};
+    getFieldData = {};
     // Special case for getfields
     if (action === 'getfields') {
       fields.push({
       return;
     }
     CRM.api3(entity, 'getFields', {'api_action': action, options: {get_options: 'all'}}).done(function(data) {
-      getFieldData = data.values;
       _.each(data.values, function(field) {
         if (field.name) {
+          getFieldData[field.name] = field;
           fields.push({
             id: field.name,
             text: field.title || field.name,