From 1cf05c3e9a752bf6f6f005e2ba316e9064e6e7be Mon Sep 17 00:00:00 2001 From: Deepak Srivastava Date: Tue, 1 Apr 2014 13:08:32 +0530 Subject: [PATCH] dedupe hooks to make custom rules manageable thru UI + a flip hook --- CRM/Contact/Form/DedupeRules.php | 1 + CRM/Dedupe/BAO/RuleGroup.php | 1 + CRM/Dedupe/Merger.php | 1 + 3 files changed, 3 insertions(+) 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 -- 2.25.1