dedupe hooks to make custom rules manageable thru UI + a flip hook
authorDeepak Srivastava <deepak.srivastava.0303@gmail.com>
Tue, 1 Apr 2014 07:38:32 +0000 (13:08 +0530)
committerDeepak Srivastava <deepak.srivastava.0303@gmail.com>
Tue, 1 Apr 2014 07:38:32 +0000 (13:08 +0530)
CRM/Contact/Form/DedupeRules.php
CRM/Dedupe/BAO/RuleGroup.php
CRM/Dedupe/Merger.php

index 49693acab7538ea98c94ce908466b5fa9143b789..e8030241338561a99105512ac3b9426194c807cd 100644 (file)
@@ -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
index c203b8c3ad9021b9236089e37ca8fe9fc92adcec..20fbcc0cd9ff0dead5c4eed32b2c0e90e1f9c55c 100644 (file)
@@ -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];
   }
 
index 4958a3a5b16aef06dadce6ac65d5ff9393edf855..0e543f1d0aea116f8ec1fb7628bca483b592a17f 100644 (file)
@@ -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