$locationValues = array_filter(array_intersect_key($mappedField, array_fill_keys($locationFields, 1)));
if ($relatedContactKey) {
- if (!isset($params['relationship'][$relatedContactKey])) {
- $params['relationship'][$relatedContactKey] = [
- // These will be over-written by any the importer has chosen but defaults are based on the relationship.
- 'contact_type' => $this->getRelatedContactType($mappedField['relationship_type_id'], $mappedField['relationship_direction']),
- 'contact_sub_type' => $this->getRelatedContactSubType($mappedField['relationship_type_id'], $mappedField['relationship_direction']),
- ];
+ if ($importedValue !== '') {
+ if (!isset($params['relationship'][$relatedContactKey])) {
+ $params['relationship'][$relatedContactKey] = [
+ // These will be over-written by any the importer has chosen but defaults are based on the relationship.
+ 'contact_type' => $this->getRelatedContactType($mappedField['relationship_type_id'], $mappedField['relationship_direction']),
+ 'contact_sub_type' => $this->getRelatedContactSubType($mappedField['relationship_type_id'], $mappedField['relationship_direction']),
+ ];
+ }
+ $this->addFieldToParams($params['relationship'][$relatedContactKey], $locationValues, $fieldName, $importedValue);
}
- $this->addFieldToParams($params['relationship'][$relatedContactKey], $locationValues, $fieldName, $importedValue);
}
else {
$this->addFieldToParams($params, $locationValues, $fieldName, $importedValue);
First Name,Last Name,Dad first name,Dad Last name,Dad email
Bob,Smith,William,The Kid,billy-the-kid@example.com
Sarah,Smith,Bill,The Grandkid,Billy-the-grand-kid@example.com
+Jenny ,Smith,,,
+Julie,Smith,Bill,,
$this->assertEquals('IMPORTED', $row['_status']);
$row = $dataSource->getRow();
$this->assertEquals('IMPORTED', $row['_status']);
+ $row = $dataSource->getRow();
+ $this->assertEquals('IMPORTED', $row['_status']);
+ $row = $dataSource->getRow();
+ // currently Error with the message (Dad to) Missing required fields: Last Name OR Email Address OR External Identifier
+ // $this->assertEquals('IMPORTED', $row['_status']);
}
/**