From 90d804edf3e14fca638b66b22e6a461a5a52af0f Mon Sep 17 00:00:00 2001 From: Mathieu Lutfy Date: Tue, 31 Mar 2015 14:02:01 -0400 Subject: [PATCH] CRM-6131: Allow to override the dedupe rule used when submitting a form (useful for buildForm hooks). --- CRM/Profile/Form.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CRM/Profile/Form.php b/CRM/Profile/Form.php index 257de4cbd3..cf276a1c37 100644 --- a/CRM/Profile/Form.php +++ b/CRM/Profile/Form.php @@ -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) { -- 2.25.1