removed something
This commit is contained in:
parent
96473fd60b
commit
622f53e401
|
|
@ -3112,17 +3112,17 @@ private function upsertAddress(int $personId, array $addrData, $mappings): array
|
|||
$addressLine = preg_replace('/\s*([,;\/])\s*/', '$1 ', $addressLine);
|
||||
$addressLine = trim($addressLine);
|
||||
// Skip common placeholders or missing values
|
||||
if ($addressLine === '' || $addressLine === '0' || strcasecmp($addressLine, '#N/A') === 0 || preg_match('/^(#?n\/?a|na|null|none)$/i', $addressLine)) {
|
||||
if ($addressLine === '' || $addressLine === '0' || preg_match('/^(#?n\/?a|na|null|none)$/i', $addressLine)) {
|
||||
return ['action' => 'skipped', 'message' => 'No address value'];
|
||||
}
|
||||
if (mb_strlen($addressLine) < 3) {
|
||||
return ['action' => 'skipped', 'message' => 'Invalid address value'];
|
||||
}
|
||||
// If identical address already exists anywhere, skip to avoid constraint violation
|
||||
$existingAny = PersonAddress::where('address', $addressLine)->first();
|
||||
/*$existingAny = PersonAddress::where('address', $addressLine)->first();
|
||||
if ($existingAny) {
|
||||
return ['action' => 'skipped', 'message' => 'Address already exists in database'];
|
||||
}
|
||||
}*/
|
||||
// Default country SLO if not provided
|
||||
if (! isset($addrData['country']) || $addrData['country'] === null || $addrData['country'] === '') {
|
||||
$addrData['country'] = 'SLO';
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user