From 9ced3228bf0e09b393ac250e265691576632c9a8 Mon Sep 17 00:00:00 2001 From: Luca Haid Date: Thu, 15 May 2025 15:12:46 +0200 Subject: [PATCH] added new debugging --- .../ConstructionConsent/ConstructionConsentController.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/application/ConstructionConsent/ConstructionConsentController.php b/application/ConstructionConsent/ConstructionConsentController.php index 003d6065f..0f1ae7b93 100644 --- a/application/ConstructionConsent/ConstructionConsentController.php +++ b/application/ConstructionConsent/ConstructionConsentController.php @@ -1083,11 +1083,12 @@ class ConstructionConsentController extends mfBaseController { if (!is_numeric($projectId) || $projectId < 1) { $this->layout()->setFlash("Projekt nicht gefunden", "error"); return $this->redirect("ConstructionConsent"); } if (!($consentProject = new ConstructionConsentProject($projectId))->id) { $this->layout()->setFlash("Projekt nicht gefunden", "error"); return $this->redirect("ConstructionConsent"); } - $counts = ["created" => 0, "updated" => 0, "skipped" => 0]; + $counts = ["created" => 0, "updated" => 0, "skipped" => 0, "skippedBecauseNoConsent" => 0, "skippedBecauseAlreadyExists" => 0, "skippedBecauseFirstnameAndLastname" => 0]; foreach ($importData as $ownerData) { $consentFilter = ["constructionconsentproject_id" => $consentProject->id, "kg" => $ownerData["KG-EZ"] ?? null, "ez" => $ownerData["EZ"] ?? null, "lnr" => $ownerData["LNR"] ?? null]; if (!($consentRecords = ConstructionConsent::search(array_filter($consentFilter)))) { + $counts["skippedBecauseNoConsent"]++; $counts["skipped"]++; continue; } @@ -1102,6 +1103,7 @@ class ConstructionConsentController extends mfBaseController { $ownerRecord->constructionconsent_id = $consentRecord->id; $ownerRecord->create_by = $this->me->id; } else { + $counts["skippedBecauseAlreadyExists"]++; $counts["skipped"]++; continue; } @@ -1125,6 +1127,7 @@ class ConstructionConsentController extends mfBaseController { $ownerRecord->edit_by = $this->me->id; if (empty($ownerRecord->firstname) && empty($ownerRecord->lastname)) { + $counts["skippedBecauseFirstnameAndLastname"]++; $counts["skipped"]++; continue; }