diff --git a/CRM/Contact/Import/Parser/Contact.php b/CRM/Contact/Import/Parser/Contact.php index bd2117ad8b35..8e369a0e779d 100644 --- a/CRM/Contact/Import/Parser/Contact.php +++ b/CRM/Contact/Import/Parser/Contact.php @@ -2637,44 +2637,45 @@ public function &getActiveFieldParams() { $importedValue = $this->_activeFields[$i]->_value; if (isset($importedValue)) { - if (isset($locationTypeID)) { - if (!isset($params[$fieldName])) { - $params[$fieldName] = []; - } + if (!$relatedContactKey) { + if (isset($locationTypeID)) { + if (!isset($params[$fieldName])) { + $params[$fieldName] = []; + } - $value = [ - $fieldName => $importedValue, - 'location_type_id' => $locationTypeID, - ]; + $value = [ + $fieldName => $importedValue, + 'location_type_id' => $locationTypeID, + ]; - if (isset($phoneTypeID)) { - $value['phone_type_id'] = $phoneTypeID; - } + if (isset($phoneTypeID)) { + $value['phone_type_id'] = $phoneTypeID; + } - // get IM service Provider type id - if (isset($imProviderID)) { - $value['provider_id'] = $imProviderID; - } + // get IM service Provider type id + if (isset($imProviderID)) { + $value['provider_id'] = $imProviderID; + } - $params[$fieldName][] = $value; - } - elseif (isset($websiteTypeID)) { - $value = [ - $fieldName => $importedValue, - 'website_type_id' => $websiteTypeID, - ]; + $params[$fieldName][] = $value; + } + elseif (isset($websiteTypeID)) { + $value = [ + $fieldName => $importedValue, + 'website_type_id' => $websiteTypeID, + ]; - $params[$fieldName][] = $value; - } + $params[$fieldName][] = $value; + } - if (!isset($params[$fieldName])) { - if (!isset($relatedContactKey)) { - $params[$fieldName] = $importedValue; + if (!isset($params[$fieldName])) { + if (!isset($relatedContactKey)) { + $params[$fieldName] = $importedValue; + } } - } - //minor fix for CRM-4062 - if (isset($relatedContactKey)) { + } + else { if (!isset($params[$relatedContactKey])) { $params[$relatedContactKey] = []; }