From 1e8be62bbc959f0d21fe687122b49dc032c1833f Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Tue, 24 Jul 2018 14:42:06 -0400 Subject: [PATCH] Exclude current contact from dupe check --- api/v3/Contact.php | 2 +- templates/CRM/Contact/Form/Contact.tpl | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/api/v3/Contact.php b/api/v3/Contact.php index 5d3ecc7af1..d2785fc372 100644 --- a/api/v3/Contact.php +++ b/api/v3/Contact.php @@ -1360,7 +1360,7 @@ function civicrm_api3_contact_duplicatecheck($params) { $params['match'], $params['match']['contact_type'], $params['rule_type'], - array(), + CRM_Utils_Array::value('exclude', $params, []), CRM_Utils_Array::value('check_permissions', $params), CRM_Utils_Array::value('dedupe_rule_id', $params) ); diff --git a/templates/CRM/Contact/Form/Contact.tpl b/templates/CRM/Contact/Form/Contact.tpl index ddfb80ec7f..fc67bd80e0 100644 --- a/templates/CRM/Contact/Form/Contact.tpl +++ b/templates/CRM/Contact/Form/Contact.tpl @@ -113,6 +113,7 @@ CRM.$(function($) { var $form = $("form.{/literal}{$form.formClass}{literal}"), action = {/literal}{$action|intval}{literal}, + cid = {/literal}{$contactId|intval}{literal}, _ = CRM._; $('.crm-accordion-body').each( function() { @@ -335,6 +336,7 @@ if (rule) { params.rule_type = rule; params.match = match; + params.exclude = cid ? [cid] : []; } else { _.extend(params, match); } -- 2.25.1