From 95519b124e1e3709952c7033ef13d68e257448d9 Mon Sep 17 00:00:00 2001 From: eileen Date: Mon, 21 Dec 2020 18:26:15 +1300 Subject: [PATCH] Switch to using shared function to call deprecated function With this done all the functionality in the deprecated function can be moved into the shared function --- CRM/Contribute/Import/Parser/Contribution.php | 6 +----- CRM/Import/Parser.php | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/CRM/Contribute/Import/Parser/Contribution.php b/CRM/Contribute/Import/Parser/Contribution.php index d871a07505..26c4c47ef7 100644 --- a/CRM/Contribute/Import/Parser/Contribution.php +++ b/CRM/Contribute/Import/Parser/Contribution.php @@ -352,10 +352,6 @@ class CRM_Contribute_Import_Parser_Contribution extends CRM_Contribute_Import_Pa } if ($this->_contactIdIndex < 0) { - // set the contact type if its not set - if (!isset($paramValues['contact_type'])) { - $paramValues['contact_type'] = $this->_contactType; - } $error = $this->checkContactDuplicate($paramValues); @@ -911,7 +907,7 @@ class CRM_Contribute_Import_Parser_Contribution extends CRM_Contribute_Import_Pa } else { // we need to get contribution contact using de dupe - $error = _civicrm_api3_deprecated_check_contact_dedupe($params); + $error = $this->checkContactDuplicate($params); if (isset($error['error_message']['params'][0])) { $matchedIDs = explode(',', $error['error_message']['params'][0]); diff --git a/CRM/Import/Parser.php b/CRM/Import/Parser.php index 3aa731f55f..05a22b58bb 100644 --- a/CRM/Import/Parser.php +++ b/CRM/Import/Parser.php @@ -524,7 +524,7 @@ abstract class CRM_Import_Parser { */ protected function checkContactDuplicate(&$formatValues) { //retrieve contact id using contact dedupe rule - $formatValues['contact_type'] = $this->_contactType; + $formatValues['contact_type'] = $formatValues['contact_type'] ?? $this->_contactType; $formatValues['version'] = 3; require_once 'CRM/Utils/DeprecatedUtils.php'; $error = _civicrm_api3_deprecated_check_contact_dedupe($formatValues); -- 2.25.1