CRM-6131: Allow to override the dedupe rule used when submitting a form (useful for...
authorMathieu Lutfy <mathieu@bidon.ca>
Tue, 31 Mar 2015 18:02:01 +0000 (14:02 -0400)
committerMathieu Lutfy <mathieu@bidon.ca>
Tue, 31 Mar 2015 18:02:01 +0000 (14:02 -0400)
CRM/Profile/Form.php

index 257de4cbd309cec116acc2dd822518978ffb6c78..cf276a1c374b9e15d1361a6f229ec24dc3954d5f 100644 (file)
@@ -111,6 +111,12 @@ class CRM_Profile_Form extends CRM_Core_Form {
    */
   public $_isUpdateDupe = 0;
 
+  /**
+   * Dedupe using a specific rule (CRM-6131).
+   * Not currently exposed in profile settings, but can be set in a buildForm hook.
+   */
+  public $_ruleGroupID = NULL;
+
   public $_isAddCaptcha = FALSE;
 
   protected $_isPermissionedChecksum = FALSE;
@@ -946,7 +952,8 @@ class CRM_Profile_Form extends CRM_Core_Form {
       $ids = CRM_Dedupe_Finder::dupesByParams($dedupeParams,
         $ctype,
         $ruleType,
-        $exceptions
+        $exceptions,
+        $form->_ruleGroupID
       );
       if ($ids) {
         if ($form->_isUpdateDupe == 2) {