From 5147800ea30caf57b6de80004dca53fa00a589b9 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Wed, 15 Feb 2017 12:45:19 -0500 Subject: [PATCH] API Explorer: Don't show non-joinable fields as joinable --- api/v3/utils.php | 4 +++- templates/CRM/Admin/Page/APIExplorer.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/api/v3/utils.php b/api/v3/utils.php index c232e0412e..1e5400b419 100644 --- a/api/v3/utils.php +++ b/api/v3/utils.php @@ -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); } diff --git a/templates/CRM/Admin/Page/APIExplorer.js b/templates/CRM/Admin/Page/APIExplorer.js index bbcc726095..3bca15f509 100644 --- a/templates/CRM/Admin/Page/APIExplorer.js +++ b/templates/CRM/Admin/Page/APIExplorer.js @@ -886,7 +886,7 @@ 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, -- 2.25.1