CRM-17857 - Update api explorer to exclude participant joins
authorColeman Watts <coleman@civicrm.org>
Sat, 23 Jan 2016 03:23:25 +0000 (22:23 -0500)
committerColeman Watts <coleman@civicrm.org>
Sat, 23 Jan 2016 03:23:25 +0000 (22:23 -0500)
templates/CRM/Admin/Page/APIExplorer.js

index 4c670e43bcac88d0664d60a799ac3f8f329bebc2..3696c7ce6190b1322b82422d14b71c3913ced8b7 100644 (file)
     docCodeTpl = _.template($('#doc-code-tpl').html()),
     joinTpl = _.template($('#join-tpl').html()),
 
+    // The following apis do not support the syntax for joins
+    // FIXME: the solution is to convert these apis to use _civicrm_api3_basic_get
+    NO_JOINS = ['Contact', 'Contribution', 'Pledge', 'Participant'],
+
     // These types of entityRef don't require any input to open
     // FIXME: ought to be in getfields metadata
     OPEN_IMMEDIATELY = ['RelationshipType', 'Event', 'Group', 'Tag'],
    */
   function renderJoinSelector() {
     $('#api-join').hide();
-    if (!_.includes(['Contact', 'Contribution', 'Pledge'], entity) && _.includes(['get', 'getsingle'], action)) {
+    if (!_.includes(NO_JOINS, entity) && _.includes(['get', 'getsingle'], action)) {
       var joinable = {};
       (function recurse(fields, joinable, prefix, depth, entities) {
         _.each(fields, function(field) {