Another unreachable place - code is always duplicate if it is an array
authorEileen McNaughton <emcnaughton@wikimedia.org>
Mon, 30 May 2022 22:27:08 +0000 (10:27 +1200)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Mon, 30 May 2022 22:27:08 +0000 (10:27 +1200)
CRM/Contact/Import/Parser/Contact.php

index 155578ad7d38f66b27847da7b6c056c359e9fa0f..e3c450d4f7637a90ff97234f72a0b954151f7111 100644 (file)
@@ -536,17 +536,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Import_Parser {
     }
     //dupe checking
     if (is_array($newContact)) {
-      $code = NULL;
-
-      if (($code = CRM_Utils_Array::value('code', $newContact['error_message'])) && ($code == CRM_Core_Error::DUPLICATE_CONTACT)) {
-        return $this->handleDuplicateError($newContact, $values, $onDuplicate, $formatted, $contactFields);
-      }
-      // Not a dupe, so we had an error
-      $errorMessage = $newContact['error_message'];
-      array_unshift($values, $errorMessage);
-      $this->setImportStatus((int) $values[count($values) - 1], 'ERROR', $errorMessage);
-      return CRM_Import_Parser::ERROR;
-
+      return $this->handleDuplicateError($newContact, $values, $onDuplicate, $formatted, $contactFields);
     }
 
     if (empty($this->_unparsedStreetAddressContacts)) {