From 38a148414712935fed9a90cdc2d46943be87857f Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Tue, 18 Oct 2016 20:19:51 -0400 Subject: [PATCH] CRM-19535 - Conditionally add is_active param to entityRef --- api/v3/Event.php | 10 ++++++---- api/v3/MembershipType.php | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/api/v3/Event.php b/api/v3/Event.php index d79674c48e..1866b51e88 100644 --- a/api/v3/Event.php +++ b/api/v3/Event.php @@ -226,10 +226,12 @@ function _civicrm_api3_event_getlist_params(&$request) { $fieldsToReturn = array('start_date', 'event_type_id', 'title', 'summary'); $request['params']['return'] = array_unique(array_merge($fieldsToReturn, $request['extra'])); $request['params']['options']['sort'] = 'start_date DESC'; - $request['params'] += array( - 'is_template' => 0, - 'is_active' => 1, - ); + if (empty($request['params']['id'])) { + $request['params'] += array( + 'is_template' => 0, + 'is_active' => 1, + ); + } } /** diff --git a/api/v3/MembershipType.php b/api/v3/MembershipType.php index fb29a18d7d..4935bfa206 100644 --- a/api/v3/MembershipType.php +++ b/api/v3/MembershipType.php @@ -109,7 +109,7 @@ function civicrm_api3_membership_type_get($params) { * Array of parameters determined by getfields. */ function _civicrm_api3_membership_type_getlist_params(&$request) { - if (!isset($request['params']['is_active'])) { + if (!isset($request['params']['is_active']) && empty($request['params']['id'])) { $request['params']['is_active'] = 1; } } -- 2.25.1