fixed when creating owner

This commit is contained in:
Luca Haid
2025-04-22 17:53:46 +02:00
parent 7932ad7ca4
commit ed314e5dfa

View File

@@ -1063,7 +1063,10 @@ class ConstructionConsentController extends mfBaseController {
if ($birthdate) { $ownerFilter["birthdate"] = $birthdate; }
$isNew = !($ownerRecord = ConstructionConsentOwner::getFirst(array_filter($ownerFilter)));
if ($isNew) $ownerRecord = new ConstructionConsentOwner(["constructionconsent_id" => $consentRecord->id]);
if ($isNew) {
$ownerRecord = new ConstructionConsentOwner();
$ownerRecord->constructionconsent_id = $consentRecord->id;
}
$addressKey = null; foreach(array_keys($ownerData) as $k) { if(strpos($k,"ADR") === 0) {$addressKey=$k; break;} }
$street = $city = $postcode = $country = null;