From 9c5fe5725e5cea9cd50d320aeadd3166e56369a9 Mon Sep 17 00:00:00 2001 From: eileen Date: Wed, 22 May 2019 16:38:56 +1200 Subject: [PATCH] [code-cleanup] remove orderBy param from getDuplicatePairs, it is not used --- CRM/Contact/Page/DedupeFind.php | 2 +- CRM/Dedupe/Merger.php | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CRM/Contact/Page/DedupeFind.php b/CRM/Contact/Page/DedupeFind.php index 56eba2c984..8b22a7140d 100644 --- a/CRM/Contact/Page/DedupeFind.php +++ b/CRM/Contact/Page/DedupeFind.php @@ -182,7 +182,7 @@ class CRM_Contact_Page_DedupeFind extends CRM_Core_Page_Basic { CRM_Dedupe_Merger::resetMergeStats($cacheKeyString); } - $this->_mainContacts = CRM_Dedupe_Merger::getDuplicatePairs($rgid, $gid, !$isConflictMode, 0, $this->isSelected(), '', $isConflictMode, $criteria, TRUE, $limit); + $this->_mainContacts = CRM_Dedupe_Merger::getDuplicatePairs($rgid, $gid, !$isConflictMode, 0, $this->isSelected(), $isConflictMode, $criteria, TRUE, $limit); if (empty($this->_mainContacts)) { if ($isConflictMode) { diff --git a/CRM/Dedupe/Merger.php b/CRM/Dedupe/Merger.php index 7e713da3a6..684393da6c 100644 --- a/CRM/Dedupe/Merger.php +++ b/CRM/Dedupe/Merger.php @@ -696,7 +696,7 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m // explicitly set to NULL if not 1 or 0 as part of grandfathering out the mystical '2' value. $isSelected = NULL; } - $dupePairs = self::getDuplicatePairs($rgid, $gid, $reloadCacheIfEmpty, $batchLimit, $isSelected, '', ($mode == 'aggressive'), $criteria, $checkPermissions); + $dupePairs = self::getDuplicatePairs($rgid, $gid, $reloadCacheIfEmpty, $batchLimit, $isSelected, ($mode == 'aggressive'), $criteria, $checkPermissions); $cacheParams = [ 'cache_key_string' => self::getMergeCacheKeyString($rgid, $gid, $criteria, $checkPermissions), @@ -1817,7 +1817,6 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m * @param int $batchLimit * @param bool $isSelected * Limit to selected pairs. - * @param array|string $orderByClause * @param bool $includeConflicts * @param array $criteria * Additional criteria to narrow down the merge group. @@ -1830,18 +1829,21 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m * * @return array * Array of matches meeting the criteria. + * + * @throws \CRM_Core_Exception + * @throws \CiviCRM_API3_Exception */ - public static function getDuplicatePairs($rule_group_id, $group_id, $reloadCacheIfEmpty, $batchLimit, $isSelected, $orderByClause = '', $includeConflicts = TRUE, $criteria = [], $checkPermissions = TRUE, $searchLimit = 0) { + public static function getDuplicatePairs($rule_group_id, $group_id, $reloadCacheIfEmpty, $batchLimit, $isSelected, $includeConflicts = TRUE, $criteria = [], $checkPermissions = TRUE, $searchLimit = 0) { $where = self::getWhereString($isSelected); $cacheKeyString = self::getMergeCacheKeyString($rule_group_id, $group_id, $criteria, $checkPermissions); $join = self::getJoinOnDedupeTable(); - $dupePairs = CRM_Core_BAO_PrevNextCache::retrieve($cacheKeyString, $join, $where, 0, $batchLimit, [], $orderByClause, $includeConflicts); + $dupePairs = CRM_Core_BAO_PrevNextCache::retrieve($cacheKeyString, $join, $where, 0, $batchLimit, [], '', $includeConflicts); if (empty($dupePairs) && $reloadCacheIfEmpty) { // If we haven't found any dupes, probably cache is empty. // Try filling cache and give another try. We don't need to specify include conflicts here are there will not be any // until we have done some processing. CRM_Core_BAO_PrevNextCache::refillCache($rule_group_id, $group_id, $cacheKeyString, $criteria, $checkPermissions, $searchLimit); - $dupePairs = CRM_Core_BAO_PrevNextCache::retrieve($cacheKeyString, $join, $where, 0, $batchLimit, [], $orderByClause, $includeConflicts); + $dupePairs = CRM_Core_BAO_PrevNextCache::retrieve($cacheKeyString, $join, $where, 0, $batchLimit, [], '', $includeConflicts); return $dupePairs; } return $dupePairs; -- 2.25.1