Bug #89774

Incomplete task configuration breaks the backend module

Added by Jan Delius 6 months ago. Updated 3 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
scheduler
Target version:
-
Start date:
2019-11-26
Due date:
% Done:

100%

TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

If you create a new task, which should execute a console command, you have to save it before you can fill in the necessary arguments. If you now close the form, you can no longer call the Scheduler Backend module. The Symfony class "Input" throws a Symfony\Component\Console\Exception\RuntimeException because not all necessary arguments are set.

Steps to reproduce:
1. Click the "Add task" button inside the scheduler module
2. Select class "Execute console commands", select either type single or specify a frequency.
3. Select a "Schedulable Command" that has a required argument
4. Click "Save and close" (or save first and close the form after saving)
5. Scheduler module is broken now :(

Associated revisions

Revision 09cf10b6 (diff)
Added by Markus Klösges 5 months ago

[BUGFIX] Show argument validation results in scheduler list

The scheduler module now shows validation errors for execute console
commands as messages in the backend. Previously changing the
configuration of a console commands arguments could lead to an exception
when the currently selected set of arguments was not parseable anymore
with the new configuration.
In some circumstances it was also possible to save a task without
supplying all required arguments, which rendered the backend module
non-functional because of the exception.

Catching the exception and providing the error message helps spotting
and fixing these errors without having to manipulate the database
directly.

Resolves: #89774
Releases: master, 9.5
Change-Id: I838e90bdd48f7146863630fa7dd09776459393d2
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/62756
Tested-by: TYPO3com <>
Tested-by: Jörg Bösche <>
Tested-by: Daniel Goerz <>
Reviewed-by: Benni Mack <>
Reviewed-by: Jörg Bösche <>
Reviewed-by: Daniel Goerz <>

Revision 04d8ada7 (diff)
Added by Markus Klösges 5 months ago

[BUGFIX] Show argument validation results in scheduler list

The scheduler module now shows validation errors for execute console
commands as messages in the backend. Previously changing the
configuration of a console commands arguments could lead to an exception
when the currently selected set of arguments was not parseable anymore
with the new configuration.
In some circumstances it was also possible to save a task without
supplying all required arguments, which rendered the backend module
non-functional because of the exception.

Catching the exception and providing the error message helps spotting
and fixing these errors without having to manipulate the database
directly.

Resolves: #89774
Releases: master, 9.5
Change-Id: I838e90bdd48f7146863630fa7dd09776459393d2
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/62894
Tested-by: TYPO3com <>
Tested-by: Daniel Goerz <>
Reviewed-by: Daniel Goerz <>

History

#1 Updated by Gerrit Code Review 6 months ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/62756

#2 Updated by Tymoteusz Motylewski 5 months ago

I have troubles reproducing it.
can you point me to the example of ""Schedulable Command" that has a required argument?
thanks

#3 Updated by Joerg Boesche 5 months ago

Tymoteusz Motylewski wrote:

I have troubles reproducing it.
can you point me to the example of ""Schedulable Command" that has a required argument?
thanks

Hey Tymoteusz, here is an example to reproduce.

Test scenario before the patch
-------------------------------------------------------
- Add new task of type "Execute console commands (scheduler)"
- Add frequency of "*/30 * * * *"
- Select "redirects:checkintegrity: Check integrity of redirects", for example
- Save the task
- Open the class "\TYPO3\CMS\Redirects\Command\CheckIntegrityCommand" and change the InputArgument from optional to required.
- Run the previous created scheduler tasks
- An T3 exception is thrown

Test scenario after the patch (with added task before)
-------------------------------------------------------
- Run the scheduler task again
- A red notification with the text "
Execution of task "Execute console commands (scheduler)" failed with the following message: Not enough arguments (missing: "site")." is visible and no T3 exception was thrown.

#4 Updated by Gerrit Code Review 5 months ago

Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/62894

#5 Updated by Anonymous 5 months ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#6 Updated by Benni Mack 3 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF