CRM-19535 - Conditionally add is_active param to entityRef
authorColeman Watts <coleman@civicrm.org>
Wed, 19 Oct 2016 00:19:51 +0000 (20:19 -0400)
committerColeman Watts <coleman@civicrm.org>
Wed, 19 Oct 2016 00:19:51 +0000 (20:19 -0400)
api/v3/Event.php
api/v3/MembershipType.php

index d79674c48e60e6f469c3e5c57c93e72f7fca9258..1866b51e88612a80b9d0e26d252102e922f8d5f6 100644 (file)
@@ -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,
+    );
+  }
 }
 
 /**
index fb29a18d7d4b7a0d6e65b187df13f4325a7229b0..4935bfa2068fa0c52cbe11ae4cc00595b3cb353e 100644 (file)
@@ -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;
   }
 }