From 73ab3d3f5d32c1c8ff60a538c3a3361d59cd8dd7 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Wed, 16 Jun 2021 15:41:50 +1200 Subject: [PATCH] Deprecate no return on activity get It turns out that the area most causey of https://github.com/civicrm/civicrm-core/pull/18968 is activity get calls with no 'return' - which should be less that the contact.get ones so trying to deprecate no-return --- api/v3/Activity.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api/v3/Activity.php b/api/v3/Activity.php index 422ebff5905d..dee17ed5e880 100644 --- a/api/v3/Activity.php +++ b/api/v3/Activity.php @@ -298,7 +298,10 @@ function civicrm_api3_activity_get($params) { $options['return']['status_id'] = $options['return']['activity_date_time'] = 1; $params['return'] = array_keys($options['return']); } - + if (!isset($params['return'])) { + // https://github.com/civicrm/civicrm-core/pull/18968 + CRM_Core_Error::deprecatedWarning('Not setting a return array is deprecated as it will fail on complex sites.'); + } $activities = _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params, FALSE, 'Activity', $sql); if ($options['is_count']) { return civicrm_api3_create_success($activities, $params, 'Activity', 'get');