From 4bbc12e21305dab4eff56b5eb53ed7782f55c5be Mon Sep 17 00:00:00 2001 From: Jamie McClelland Date: Fri, 18 Nov 2016 14:42:25 -0500 Subject: [PATCH] CRM-19664 - continue with import even if one row has extid match problem. --- CRM/Contact/Import/Parser/Contact.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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; } -- 2.25.1