From b18bb14ecc84665f4d86b360232c5a11b32b55e7 Mon Sep 17 00:00:00 2001 From: Jan Jakes Date: Tue, 30 Apr 2024 16:14:44 +0200 Subject: [PATCH] Fix scheduled task entity having the same association twice It also seems that orphanRemoval doesn't play well with our explicit detachAll logic. [MAILPOET-6047] --- mailpoet/lib/Entities/ScheduledTaskEntity.php | 7 ------- mailpoet/lib/Entities/ScheduledTaskSubscriberEntity.php | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/mailpoet/lib/Entities/ScheduledTaskEntity.php b/mailpoet/lib/Entities/ScheduledTaskEntity.php index 3d141223b4..c16b16a07e 100644 --- a/mailpoet/lib/Entities/ScheduledTaskEntity.php +++ b/mailpoet/lib/Entities/ScheduledTaskEntity.php @@ -95,15 +95,8 @@ class ScheduledTaskEntity { */ private $sendingQueue; - /** - * @ORM\OneToMany(targetEntity="MailPoet\Entities\ScheduledTaskSubscriberEntity", mappedBy="task", orphanRemoval=true) - * @var Collection - */ - private $scheduledTaskSubscribers; - public function __construct() { $this->subscribers = new ArrayCollection(); - $this->scheduledTaskSubscribers = new ArrayCollection(); } /** diff --git a/mailpoet/lib/Entities/ScheduledTaskSubscriberEntity.php b/mailpoet/lib/Entities/ScheduledTaskSubscriberEntity.php index 2ef4ec75e2..268b34a4e2 100644 --- a/mailpoet/lib/Entities/ScheduledTaskSubscriberEntity.php +++ b/mailpoet/lib/Entities/ScheduledTaskSubscriberEntity.php @@ -45,7 +45,7 @@ class ScheduledTaskSubscriberEntity { private $error; /** - * @ORM\Id @ORM\ManyToOne(targetEntity="MailPoet\Entities\ScheduledTaskEntity", inversedBy="scheduledTaskSubscribers") + * @ORM\Id @ORM\ManyToOne(targetEntity="MailPoet\Entities\ScheduledTaskEntity", inversedBy="subscribers") * @var ScheduledTaskEntity|null */ private $task;