From ed314e5dfa487eb9b0d22215b7866f39697830d7 Mon Sep 17 00:00:00 2001 From: Luca Haid Date: Tue, 22 Apr 2025 17:53:46 +0200 Subject: [PATCH] fixed when creating owner --- .../ConstructionConsent/ConstructionConsentController.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/application/ConstructionConsent/ConstructionConsentController.php b/application/ConstructionConsent/ConstructionConsentController.php index 35af915a3..b65612fb8 100644 --- a/application/ConstructionConsent/ConstructionConsentController.php +++ b/application/ConstructionConsent/ConstructionConsentController.php @@ -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;