From: Jamie McClelland Date: Fri, 18 Nov 2016 19:42:25 +0000 (-0500) Subject: CRM-19664 - continue with import even if one row has extid match X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=4bbc12e21305dab4eff56b5eb53ed7782f55c5be;p=civicrm-core.git CRM-19664 - continue with import even if one row has extid match problem. --- diff --git a/CRM/Contact/Import/Parser/Contact.php b/CRM/Contact/Import/Parser/Contact.php index 2cffc5dc91..4e3cb95ad5 100644 --- a/CRM/Contact/Import/Parser/Contact.php +++ b/CRM/Contact/Import/Parser/Contact.php @@ -539,7 +539,20 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { // Get contact id to format common data in update/fill mode, // prioritising a dedupe rule check over an external_identifier check, but falling back on ext id. if ($this->_updateWithId && empty($params['id'])) { - $possibleMatches = $this->getPossibleContactMatches($params); + try { + $possibleMatches = $this->getPossibleContactMatches($params); + } + catch (CRM_Core_Exception $e) { + $errorMessage = $e->getMessage(); + array_unshift($values, $errorMessage); + + $importRecordParams = array( + $statusFieldName => 'ERROR', + "${statusFieldName}Msg" => $errorMessage + ); + $this->updateImportRecord($values[count($values) - 1], $importRecordParams); + return CRM_Import_Parser::ERROR; + } foreach ($possibleMatches as $possibleID) { $params['id'] = $formatted['id'] = $possibleID; }