Skip to content
Snippets Groups Projects
Commit 1c8e2808 authored by Eileen McNaughton's avatar Eileen McNaughton
Browse files

[Import] Remove empty if

parent 2bb4289c
Branches
Tags
No related merge requests found
......@@ -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
......
......@@ -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.
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment