Only some statuses can be updated

We want to maintain the previous behaviour

[MAILPOET-3481]
This commit is contained in:
Pavel Dohnal
2021-03-19 12:01:44 +01:00
committed by Veljko V
parent 95825793c0
commit 63db6737df

View File

@ -281,7 +281,10 @@ class NewsletterEntity {
if ($task === null) continue;
$scheduled = new Carbon($task->getScheduledAt());
if ($scheduled < (new Carbon())->subDays(30)) return;
if ($scheduled < (new Carbon())->subDays(30)) continue;
if (($status === self::STATUS_DRAFT) && ($task->getStatus() !== ScheduledTaskEntity::STATUS_SCHEDULED)) continue;
if (($status === self::STATUS_ACTIVE) && ($task->getStatus() !== ScheduledTaskEntity::STATUS_PAUSED)) continue;
$task->setStatus($newTaskStatus);
}