From 3dcafb5afb9daa56fcfa29a666b1427805c10724 Mon Sep 17 00:00:00 2001 From: Tobias Zulauf Date: Tue, 7 Jan 2025 09:53:03 +0100 Subject: [PATCH] [5.3] Improve inline comment for the "none-ID" behavior within the CRON Scheduler (#43817) --- .../schedulerunner/src/Extension/ScheduleRunner.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/plugins/system/schedulerunner/src/Extension/ScheduleRunner.php b/plugins/system/schedulerunner/src/Extension/ScheduleRunner.php index 65438995db52b..f462a9ebac0da 100644 --- a/plugins/system/schedulerunner/src/Extension/ScheduleRunner.php +++ b/plugins/system/schedulerunner/src/Extension/ScheduleRunner.php @@ -170,11 +170,10 @@ public function runLazyCron(EventInterface $e) } /** - * This method is responsible for the WebCron functionality of the Scheduler component.
+ * This method is responsible for the WebCron functionality of the Scheduler component. * Acting on a `com_ajax` call, this method can work in two ways: - * 1. If no Task ID is specified, it triggers the Scheduler to run the next task in - * the task queue. - * 2. If a Task ID is specified, it fetches the task (if it exists) from the Scheduler API and executes it.
+ * 1. If no Task ID is specified, it triggers the Scheduler to run the next task in the task queue. + * 2. If a Task ID is specified, it fetches the task (if it exists) from the Scheduler API and executes it. * * URL query parameters: * - `hash` string (required) Webcron hash (from the Scheduler component configuration). @@ -202,8 +201,10 @@ public function runWebCron(Event $event) throw new \Exception($this->getApplication()->getLanguage()->_('JERROR_ALERTNOAUTHOR'), 403); } + // Check whether there is an id passed via the URL $id = (int) $this->getApplication()->getInput()->getInt('id', 0); + // When the id is set to 0 the next task is executed $task = $this->runScheduler($id); if (!empty($task) && !empty($task->getContent()['exception'])) {