From 40e80f76ecd60b9a0ed8ddbe491d139f4eea0186 Mon Sep 17 00:00:00 2001 From: Robert Zondervan Date: Tue, 18 Apr 2023 14:41:22 +0200 Subject: [PATCH 1/2] Prevent creating new actions on every run --- src/Service/InvitePartnerService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Service/InvitePartnerService.php b/src/Service/InvitePartnerService.php index 4c1eed7..cd9bcdc 100644 --- a/src/Service/InvitePartnerService.php +++ b/src/Service/InvitePartnerService.php @@ -140,7 +140,7 @@ private function createEmailAndSmsData(ObjectEntity $requester, ObjectEntity $pe */ private function invitePartner(array $huwelijk, string $id): ?array { - $this->entityManager->clear(); + $this->entityManager->clear('App\Entity\ObjectEntity'); $huwelijkObject = $this->entityManager->getRepository('App:ObjectEntity')->find($id); if ($huwelijkObject instanceof ObjectEntity === false) { $this->pluginLogger->error('Could not find huwelijk with id '.$id); From a3b75f56ed4d44c3e10ac1280c4a21b565c66a6a Mon Sep 17 00:00:00 2001 From: Robert Zondervan Date: Wed, 19 Apr 2023 11:38:21 +0200 Subject: [PATCH 2/2] Fix 500 on witnesses --- src/Service/InviteWitnessService.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Service/InviteWitnessService.php b/src/Service/InviteWitnessService.php index b468afc..74f6ae3 100644 --- a/src/Service/InviteWitnessService.php +++ b/src/Service/InviteWitnessService.php @@ -250,6 +250,9 @@ private function inviteWitness(array $huwelijk, string $id): array $huwelijkObject = $this->updateChecklistService->checkHuwelijk($huwelijkObject); }//end if + $this->entityManager->persist($huwelijkObject); + $this->entityManager->flush(); + return $huwelijkObject->toArray(); }//end inviteWitness()