Commit a7aed606 authored by eileen's avatar eileen 🎱 Committed by GitHub

Merge pull request #9873 from eileenmcnaughton/dedupe_code

CRM-20154 dedupe code improvement, remove unused autoflip parameter
parents 3654988d f2e3129e
......@@ -281,7 +281,7 @@ WHERE v.option_group_id = g.id
*
* @param bool $flip
*/
public static function lookupValues(&$params, &$names, $flip = FALSE) {
public static function lookupValues(&$params, $names, $flip = FALSE) {
foreach ($names as $postName => $value) {
// See if $params field is in $names array (i.e. is a value that we need to lookup)
if ($postalName = CRM_Utils_Array::value($postName, $params)) {
......
......@@ -614,7 +614,7 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m
'join' => self::getJoinOnDedupeTable(),
'where' => self::getWhereString($batchLimit, $isSelected),
);
return CRM_Dedupe_Merger::merge($dupePairs, $cacheParams, $mode, $autoFlip, $redirectForPerformance, $checkPermissions);
return CRM_Dedupe_Merger::merge($dupePairs, $cacheParams, $mode, $redirectForPerformance, $checkPermissions);
}
/**
......@@ -748,8 +748,6 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m
* Helps decide how to behave when there are conflicts.
* A 'safe' value skips the merge if there are any un-resolved conflicts.
* Does a force merge otherwise (aggressive mode).
* @param bool $autoFlip to let api decide which contact to retain and which to delete.
* Whether to let api decide which contact to retain and which to delete.
*
* @param bool $redirectForPerformance
* Redirect to a url for batch processing.
......@@ -760,7 +758,7 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m
* @return array|bool
*/
public static function merge($dupePairs = array(), $cacheParams = array(), $mode = 'safe',
$autoFlip = TRUE, $redirectForPerformance = FALSE, $checkPermissions = TRUE
$redirectForPerformance = FALSE, $checkPermissions = TRUE
) {
$cacheKeyString = CRM_Utils_Array::value('cache_key_string', $cacheParams);
$resultStats = array('merged' => array(), 'skipped' => array());
......
......@@ -1116,7 +1116,7 @@ function civicrm_api3_contact_merge($params) {
'srcID' => $params['to_remove_id'],
'dstID' => $params['to_keep_id'],
),
), array(), $params['mode'], $params['auto_flip'])) != FALSE) {
), array(), $params['mode'])) != FALSE) {
return civicrm_api3_create_success($result, $params);
}
throw new CiviCRM_API3_Exception('Merge failed');
......@@ -1142,10 +1142,6 @@ function _civicrm_api3_contact_merge_spec(&$params) {
'type' => CRM_Utils_Type::T_INT,
'api.aliases' => array('other_id'),
);
$params['auto_flip'] = array(
'title' => 'Swap destination and source to retain lowest id?',
'api.default' => TRUE,
);
$params['mode'] = array(
// @todo need more detail on what this means.
'title' => 'Dedupe mode',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment