diff --git a/CRM/Contact/Form/Contact.php b/CRM/Contact/Form/Contact.php
index 1b985e131fb0..1deb5ea20a14 100644
--- a/CRM/Contact/Form/Contact.php
+++ b/CRM/Contact/Form/Contact.php
@@ -714,7 +714,7 @@ public static function formRule($fields, &$errors, $contactId, $contactType) {
}
// Check for duplicate contact if it wasn't already handled by ajax or disabled
- if (!Civi::settings()->get('contact_ajax_check_similar')) {
+ if (!Civi::settings()->get('contact_ajax_check_similar') || !empty($fields['_qf_Contact_refresh_dedupe'])) {
self::checkDuplicateContacts($fields, $errors, $contactId, $contactType);
}
@@ -760,7 +760,7 @@ public function buildQuickForm() {
$className::buildQuickForm($this);
// Ajax duplicate checking
- $checkSimilar = $this->_action == CRM_Core_Action::ADD && Civi::settings()->get('contact_ajax_check_similar');
+ $checkSimilar = Civi::settings()->get('contact_ajax_check_similar');
$this->assign('checkSimilar', $checkSimilar);
if ($checkSimilar == 1) {
$ruleParams = array('used' => 'Supervised', 'contact_type' => $this->_contactType);
diff --git a/api/v3/Contact.php b/api/v3/Contact.php
index 5d3ecc7af1cd..d2785fc372e1 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 7c0302360c87..fc67bd80e0b0 100644
--- a/templates/CRM/Contact/Form/Contact.tpl
+++ b/templates/CRM/Contact/Form/Contact.tpl
@@ -112,7 +112,8 @@
+
{/literal}