From 1c8e2808c5d3a194a5ba3c6c201b5988a031fa80 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Sat, 21 May 2022 10:21:22 +1200 Subject: [PATCH] [Import] Remove empty if --- CRM/Contact/Import/Parser/Contact.php | 6 ------ CRM/Import/Parser.php | 26 -------------------------- 2 files changed, 32 deletions(-) diff --git a/CRM/Contact/Import/Parser/Contact.php b/CRM/Contact/Import/Parser/Contact.php index 1d66be5885..9ab36de0c1 100644 --- a/CRM/Contact/Import/Parser/Contact.php +++ b/CRM/Contact/Import/Parser/Contact.php @@ -472,12 +472,6 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Import_Parser { // Support Match and Update Via Contact ID if ($this->_updateWithId && isset($params['id'])) { $createNewContact = FALSE; - // @todo - it feels like all the rows from here to the end of the IF - // could be removed in favour of a simple check for whether the contact_type & id match - $matchedIDs = $this->getIdsOfMatchingContacts($formatted); - if (!empty($matchedIDs)) { - - } } //fixed CRM-4148 diff --git a/CRM/Import/Parser.php b/CRM/Import/Parser.php index f5045ff245..37986d5046 100644 --- a/CRM/Import/Parser.php +++ b/CRM/Import/Parser.php @@ -1108,32 +1108,6 @@ abstract class CRM_Import_Parser { return $values; } - /** - * Get the ids of any contacts that match according to the rule. - * - * @param array $formatted - * - * @return array - */ - protected function getIdsOfMatchingContacts(array $formatted):array { - if ($formatted['id'] ?? NULL) { - return [$formatted['id']]; - } - - // the call to the deprecated function seems to add no value other that to do an additional - // check for the contact_id & type. - $error = _civicrm_api3_deprecated_duplicate_formatted_contact($formatted); - if (!CRM_Core_Error::isAPIError($error, CRM_Core_ERROR::DUPLICATE_CONTACT)) { - return []; - } - if (is_array($error['error_message']['params'][0])) { - return $error['error_message']['params'][0]; - } - else { - return explode(',', $error['error_message']['params'][0]); - } - } - /** * Validate that the field requirements are met in the params. * -- 2.25.1