From: Deepak Srivastava Date: Tue, 1 Apr 2014 07:38:32 +0000 (+0530) Subject: dedupe hooks to make custom rules manageable thru UI + a flip hook X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=1cf05c3e9a752bf6f6f005e2ba316e9064e6e7be;p=civicrm-core.git dedupe hooks to make custom rules manageable thru UI + a flip hook --- diff --git a/CRM/Contact/Form/DedupeRules.php b/CRM/Contact/Form/DedupeRules.php index 49693acab7..e803024133 100644 --- a/CRM/Contact/Form/DedupeRules.php +++ b/CRM/Contact/Form/DedupeRules.php @@ -288,6 +288,7 @@ UPDATE civicrm_dedupe_rule_group // also create an index for this dedupe rule // CRM-3837 + CRM_Utils_Hook::dupeQuery($ruleDao, 'dedupeIndexes', $tables); CRM_Core_BAO_SchemaHandler::createIndexes($tables, 'dedupe_index', $substrLenghts); //need to clear cache of deduped contacts diff --git a/CRM/Dedupe/BAO/RuleGroup.php b/CRM/Dedupe/BAO/RuleGroup.php index c203b8c3ad..20fbcc0cd9 100644 --- a/CRM/Dedupe/BAO/RuleGroup.php +++ b/CRM/Dedupe/BAO/RuleGroup.php @@ -108,6 +108,7 @@ class CRM_Dedupe_BAO_RuleGroup extends CRM_Dedupe_DAO_RuleGroup { } } } + CRM_Utils_Hook::dupeQuery(CRM_Core_DAO::$_nullObject, 'supportedFields', $fields); return $fields[$requestedType]; } diff --git a/CRM/Dedupe/Merger.php b/CRM/Dedupe/Merger.php index 4958a3a5b1..0e543f1d0a 100644 --- a/CRM/Dedupe/Merger.php +++ b/CRM/Dedupe/Merger.php @@ -619,6 +619,7 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m while (!empty($dupePairs)) { foreach ($dupePairs as $dupes) { + CRM_Utils_Hook::merge('flip', $dupes, $dupes['dstID'], $dupes['srcID']); $mainId = $dupes['dstID']; $otherId = $dupes['srcID']; // make sure that $mainId is the one with lower id number