From: Seamus Lee Date: Wed, 8 Jul 2020 06:27:45 +0000 (+1000) Subject: dev/core#1858 Ensure that no duplicate contact is created by if we have the contactID... X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=49570419db5e2d6dbcac6da0afa233f94ed35738;p=civicrm-core.git dev/core#1858 Ensure that no duplicate contact is created by if we have the contactID in the post variable from the contact task form that we map that to contact_id for the dedupe params Add in a code comment describing the issue --- diff --git a/CRM/Core/BAO/UFMatch.php b/CRM/Core/BAO/UFMatch.php index b7dd9b2c80..b64db8636a 100644 --- a/CRM/Core/BAO/UFMatch.php +++ b/CRM/Core/BAO/UFMatch.php @@ -191,6 +191,12 @@ class CRM_Core_BAO_UFMatch extends CRM_Core_DAO_UFMatch { if (!empty($_POST) && !$isLogin) { $params = $_POST; $params['email'] = $uniqId; + // dev/core#1858 Ensure that if we have a contactID parameter which is set in the Create user Record contact task form + // That this contacID value is passed through as the contact_id to the get duplicate contacts function. This is necessary because for Drupal 8 this function gets invoked + // Before the civicrm_uf_match record is added where as in D7 it isn't called until the user tries to actually login. + if (!empty($params['contactID'])) { + $params['contact_id'] = $params['contactID']; + } $ids = CRM_Contact_BAO_Contact::getDuplicateContacts($params, 'Individual', 'Unsupervised', [], FALSE);