From 26904d196d110601b76da7fee9c4f8b6a2692e1b Mon Sep 17 00:00:00 2001 From: Achim Fritz Date: Fri, 25 Aug 2023 15:15:32 +0200 Subject: [PATCH] [BUGFIX] prevent Exception when create Event Queue Worker Task Fixes: #3767 --- .../Task/EventQueueWorkerTaskAdditionalFieldProvider.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Classes/Task/EventQueueWorkerTaskAdditionalFieldProvider.php b/Classes/Task/EventQueueWorkerTaskAdditionalFieldProvider.php index c66a33e4f3..db51ee32f3 100644 --- a/Classes/Task/EventQueueWorkerTaskAdditionalFieldProvider.php +++ b/Classes/Task/EventQueueWorkerTaskAdditionalFieldProvider.php @@ -48,9 +48,12 @@ public function getAdditionalFields( /** @var EventQueueWorkerTask $task */ $additionalFields = []; - if (!$task instanceof EventQueueWorkerTask) { + if ($task !== null && !($task instanceof EventQueueWorkerTask)) { return $additionalFields; } + if ($schedulerModule->getCurrentAction()->equals(Action::ADD)) { + $taskInfo['solr_eventqueueworkertask_limit'] = EventQueueWorkerTask::DEFAULT_PROCESSING_LIMIT; + } if ($schedulerModule->getCurrentAction()->equals(Action::EDIT)) { $taskInfo['solr_eventqueueworkertask_limit'] = $task->getLimit(); @@ -95,6 +98,6 @@ public function saveAdditionalFields( return; } - $task->setLimit($submittedData['solr_eventqueueworkertask_limit']); + $task->setLimit((int)$submittedData['solr_eventqueueworkertask_limit']); } }