X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=api%2Fv3%2FActivity.php;h=784095e0e444c35fa2108d5b4457b440c8a48de6;hb=5d2d8718b77fcf6f74f48f15df7101c79115e975;hp=4aa31a9da1baaa80b73205193ca0855023052516;hpb=15879bf3acf7e169f6a16be8c95e2a400d4b425d;p=civicrm-core.git diff --git a/api/v3/Activity.php b/api/v3/Activity.php index 4aa31a9da1..784095e0e4 100644 --- a/api/v3/Activity.php +++ b/api/v3/Activity.php @@ -354,10 +354,11 @@ function civicrm_api3_activity_get($params) { */ function _civicrm_activity_get_handleSourceContactNameOrderBy(&$params, &$options, $sql) { $sourceContactID = CRM_Core_PseudoConstant::getKey('CRM_Activity_BAO_ActivityContact', 'record_type_id', 'Activity Source'); - if (!empty($options['sort']) && in_array($options['sort'], [ + if (!empty($options['sort']) + && in_array($options['sort'], [ 'source_contact_name', 'source_contact_name desc', - 'source_contact_name asc' + 'source_contact_name asc', ])) { $order = substr($options['sort'], -4) === 'desc' ? 'desc' : 'asc'; $sql->join( @@ -805,7 +806,7 @@ function _civicrm_api3_activity_getlist_output($result, $request) { 'id' => $row[$request['id_field']], 'label' => $row[$request['label_field']] ? $row[$request['label_field']] : ts('(no subject)'), 'description' => [ - CRM_Core_Pseudoconstant::getLabel('CRM_Activity_BAO_Activity', 'activity_type_id', $row['activity_type_id']), + CRM_Core_PseudoConstant::getLabel('CRM_Activity_BAO_Activity', 'activity_type_id', $row['activity_type_id']), ], ]; if (!empty($row['activity_date_time'])) {