Merge pull request #21316 from colemanw/afformGet
[civicrm-core.git] / CRM / Contact / Import / Parser / Contact.php
index c27da774e572303f44433ab6c306c4813d54c768..bc5c30579728fbd7e01c41430fb7d213913679a7 100644 (file)
@@ -1068,7 +1068,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser {
           }
 
           // check for values for custom fields for checkboxes and multiselect
-          if ($isSerialized) {
+          if ($isSerialized && $dataType != 'ContactReference') {
             $value = trim($value);
             $value = str_replace('|', ',', $value);
             $mulValues = explode(',', $value);
@@ -1632,15 +1632,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser {
     $defaults = [];
     $contactObj = CRM_Contact_BAO_Contact::retrieve($contactParams, $defaults);
 
-    $modeUpdate = $modeFill = FALSE;
-
-    if ($onDuplicate == CRM_Import_Parser::DUPLICATE_UPDATE) {
-      $modeUpdate = TRUE;
-    }
-
-    if ($onDuplicate == CRM_Import_Parser::DUPLICATE_FILL) {
-      $modeFill = TRUE;
-    }
+    $modeFill = ($onDuplicate == CRM_Import_Parser::DUPLICATE_FILL);
 
     $groupTree = CRM_Core_BAO_CustomGroup::getTree($params['contact_type'], NULL, $cid, 0, NULL);
     CRM_Core_BAO_CustomGroup::setDefaults($groupTree, $defaults, FALSE, FALSE);
@@ -1892,7 +1884,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser {
       return array_keys($possibleMatches['values']);
     }
     if ($possibleMatches['count']) {
-      if (in_array($extIDMatch, array_keys($possibleMatches['values']))) {
+      if (array_key_exists($extIDMatch, $possibleMatches['values'])) {
         return [$extIDMatch];
       }
       throw new CRM_Core_Exception(ts(