if (!empty($columnDetails)) {
switch ($columnDetails['data']) {
case 'src':
- $whereClause .= " ORDER BY cc1.display_name {$dir}";
+ $orderByClause = " ORDER BY cc1.display_name {$dir}";
break;
case 'src_email':
- $whereClause .= " ORDER BY ce1.email {$dir}";
+ $orderByClause = " ORDER BY ce1.email {$dir}";
break;
case 'src_street':
- $whereClause .= " ORDER BY ca1.street_address {$dir}";
+ $orderByClause = " ORDER BY ca1.street_address {$dir}";
break;
case 'src_postcode':
- $whereClause .= " ORDER BY ca1.postal_code {$dir}";
+ $orderByClause = " ORDER BY ca1.postal_code {$dir}";
break;
case 'dst':
- $whereClause .= " ORDER BY cc2.display_name {$dir}";
+ $orderByClause = " ORDER BY cc2.display_name {$dir}";
break;
case 'dst_email':
- $whereClause .= " ORDER BY ce2.email {$dir}";
+ $orderByClause = " ORDER BY ce2.email {$dir}";
break;
case 'dst_street':
- $whereClause .= " ORDER BY ca2.street_address {$dir}";
+ $orderByClause = " ORDER BY ca2.street_address {$dir}";
break;
case 'dst_postcode':
- $whereClause .= " ORDER BY ca2.postal_code {$dir}";
+ $orderByClause = " ORDER BY ca2.postal_code {$dir}";
break;
default:
}
}
- $dupePairs = CRM_Core_BAO_PrevNextCache::retrieve($cacheKeyString, $join, $whereClause, $offset, $rowCount, $select);
+ $dupePairs = CRM_Core_BAO_PrevNextCache::retrieve($cacheKeyString, $join, $whereClause, $offset, $rowCount, $select, $orderByClause);
$iFilteredTotal = CRM_Core_DAO::singleValueQuery("SELECT FOUND_ROWS()");
$count = 0;