API Explorer: Don't show non-joinable fields as joinable
authorColeman Watts <coleman@civicrm.org>
Wed, 15 Feb 2017 17:45:19 +0000 (12:45 -0500)
committerColeman Watts <coleman@civicrm.org>
Wed, 15 Feb 2017 21:39:25 +0000 (16:39 -0500)
api/v3/utils.php
templates/CRM/Admin/Page/APIExplorer.js

index c232e0412e65537ab40e5ecdd9f49bba7236644b..1e5400b4197b7c0c6266c6fa765e0247afd45799 100644 (file)
@@ -1887,8 +1887,10 @@ function _civicrm_api_get_fields($entity, $unique = FALSE, &$params = array()) {
   $d = new $dao();
   $fields = $d->fields();
 
-  // Set html attributes for text fields
   foreach ($fields as $name => &$field) {
+    // Denote as core field
+    $field['is_core_field'] = TRUE;
+    // Set html attributes for text fields
     if (isset($field['html'])) {
       $field['html'] += (array) $d::makeAttribute($field);
     }
index bbcc7260954dd8483fe76dd8de9c054ae9090dd1..3bca15f509650d2449ba684b479ac2bc20904598 100644 (file)
           var name = prefix + field.name;
           addJoinInfo(field, name);
           var entity = field.FKApiName;
-          if (entity) {
+          if (entity && field.is_core_field) {
             joinable[name] = {
               title: field.title + ' (' + field.FKApiName + ')',
               entity: entity,