From abb4c5978811c3463251e4d0ebde5d3db4c0d34a Mon Sep 17 00:00:00 2001 From: monishdeb Date: Tue, 3 Feb 2015 15:45:29 +0530 Subject: [PATCH] CRM-15905 fix - API: problem sorting contacts on ID https://issues.civicrm.org/jira/browse/CRM-15905 --- api/v3/utils.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api/v3/utils.php b/api/v3/utils.php index 6f5f3782b0..fc41c821b2 100644 --- a/api/v3/utils.php +++ b/api/v3/utils.php @@ -527,6 +527,10 @@ function _civicrm_api3_get_using_query_object($entity, $params, $additional_opti $returnProperties = NULL; } + if (substr($sort, 0, 2) == 'id') { + $sort = $entity . "_" . $sort; + } + $newParams = CRM_Contact_BAO_Query::convertFormValues($inputParams); foreach ($newParams as &$newParam) { if ($newParam[1] == '=' && is_array($newParam[2])) { @@ -538,7 +542,6 @@ function _civicrm_api3_get_using_query_object($entity, $params, $additional_opti $newParam[2] = $sqlFilter; } } - } $skipPermissions = !empty($params['check_permissions']) ? 0 : 1; -- 2.25.1