From: Coleman Watts Date: Tue, 24 Mar 2015 02:21:07 +0000 (-0400) Subject: API Explorer - fix metadata lookup problem caused by unique names X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=932630fde8d2a65f5de6923c70046da73d0c9c2b;p=civicrm-core.git API Explorer - fix metadata lookup problem caused by unique names --- diff --git a/templates/CRM/Admin/Page/APIExplorer.js b/templates/CRM/Admin/Page/APIExplorer.js index b28273168b..1b50cb1fbd 100644 --- a/templates/CRM/Admin/Page/APIExplorer.js +++ b/templates/CRM/Admin/Page/APIExplorer.js @@ -127,7 +127,8 @@ function getFields(changedElement) { var required = []; fields = []; - options = getFieldData = {}; + options = {}; + getFieldData = {}; // Special case for getfields if (action === 'getfields') { fields.push({ @@ -142,9 +143,9 @@ 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,