From: Coleman Watts Date: Wed, 19 Oct 2016 00:19:51 +0000 (-0400) Subject: CRM-19535 - Conditionally add is_active param to entityRef X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=38a148414712935fed9a90cdc2d46943be87857f;p=civicrm-core.git CRM-19535 - Conditionally add is_active param to entityRef --- 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; } }