documents
This commit is contained in:
@@ -2365,13 +2365,15 @@ private function upsertAddress(int $personId, array $addrData, $mappings): array
|
||||
if (! $field) {
|
||||
continue;
|
||||
}
|
||||
$val = $addrData[$field] ?? null;
|
||||
// Allow alias 'postal_code' in CSV mappings but persist as 'post_code' in DB
|
||||
$targetField = $field === 'postal_code' ? 'post_code' : $field;
|
||||
$val = $addrData[$field] ?? $addrData[$targetField] ?? null;
|
||||
$mode = $map->apply_mode ?? 'both';
|
||||
if (in_array($mode, ['insert', 'both'])) {
|
||||
$applyInsert[$field] = $val;
|
||||
$applyInsert[$targetField] = $val;
|
||||
}
|
||||
if (in_array($mode, ['update', 'both'])) {
|
||||
$applyUpdate[$field] = $val;
|
||||
$applyUpdate[$targetField] = $val;
|
||||
}
|
||||
}
|
||||
if ($existing) {
|
||||
|
||||
Reference in New Issue
Block a user