Skip to content

Commit

Permalink
Deprecate no return on activity get
Browse files Browse the repository at this point in the history
It turns out that the area most causey of civicrm#18968
is activity get calls with no 'return' - which should be less that the contact.get
ones so trying to deprecate no-return
  • Loading branch information
eileenmcnaughton committed Jun 16, 2021
1 parent df67838 commit 73ab3d3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion api/v3/Activity.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 73ab3d3

Please sign in to comment.