From: eileen Date: Fri, 13 May 2016 04:20:22 +0000 (+1200) Subject: CodeClean - stop mangling orderBy into WHERE X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=239ed37700eaed162276de7ac392a0a9f9756d7a;p=civicrm-core.git CodeClean - stop mangling orderBy into WHERE --- diff --git a/CRM/Contact/Page/AJAX.php b/CRM/Contact/Page/AJAX.php index 0750017da1..2983e97720 100644 --- a/CRM/Contact/Page/AJAX.php +++ b/CRM/Contact/Page/AJAX.php @@ -762,35 +762,35 @@ LIMIT {$offset}, {$rowCount} 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: @@ -798,7 +798,7 @@ LIMIT {$offset}, {$rowCount} } } - $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;