Review main Abandoned

89594[BUGFIX] Prevent exceptions on new FormEngine scheduler task changes

Garvin Hicking CR 0 V 0 Easy +14 −2 updated 09/25/25, 14:14

Commit message

Newly created tasks utilizing FormEngine/TCA will try to validate
data based on $submittedData, but when a task is about to be created,
this data is missing the keys and data.

In order to switch the tasktype, this works similar to other
types in e.g. tt_content or newly created pages.

Review

  • Code review CR 0
  • Verified V 0
    • core-ci +1 CI

Issues 1

Files 2

Review log 1217

  1. Garvin Hicking uploaded patch set 1 05/30/25, 12:36

  2. core-ci voted on patch set 1 V -1 05/30/25, 12:47 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/79697

  3. Benni Mack uploaded patch set 2 V -1 06/02/25, 12:32

  4. core-ci voted on patch set 2 V +1 06/02/25, 12:42 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/79749

  5. Benni Mack uploaded patch set 3 V +1 06/02/25, 12:50

  6. core-ci voted on patch set 3 V +1 06/02/25, 12:56 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/79752

  7. Benni Mack uploaded patch set 4 V +1 06/02/25, 13:04

  8. Benni Mack voted on patch set 4 CR +1 V +1 06/02/25, 13:06

  9. core-ci voted on patch set 4 V +1 06/02/25, 13:10 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/79754

  10. Benjamin Franzke commented on patch set 4 CR -1 06/03/25, 06:05

    TaskService.php:250

    Pardon my ignorance, but why would we want to silence PHP warnings? This *can't* be the right approach. Why don't we fix the PHP warnings in the field providers, e.g. in OptimizeDatabaseTableAdditionalFieldProvider.php?
  11. Benni Mack commented on patch set 4 06/03/25, 11:41

    TaskService.php:250 Reply

    This is a side-effect of the current process of using DataHandler + FormEngine, as this is a custom renderType of FormEngine, because AdditionalFieldProviders deliver HTML Code directly, and distinguish between ADD and EDIT. FormEngine actually allows to change task types - this wasn't possible in the past. We could fix this in all additional field providers from Core, but then ext authors would need to fix this as well - I would say, that this would be breaking. Instead, I would like to introduce a new way to use "real" FormEngine / TCA fields and migrate away from additional field providers. There is one example here: https://review.typo3.org/c/Packages/TYPO3.CMS/+/89605
  12. Benjamin Franzke commented on patch set 4 06/03/25, 12:28

    TaskService.php:250 Reply Unresolved

    Yes, but if we are not breaking here, we need to silence warnings as long as we are support the additional field providers. So, maybe we should only catch `\Error` (if at all, I still do not like it…) or change to ``` @$provider?->saveAdditionalFields($incomingData, $task); ``` which should be better and more explicit than the catch-all-and-everything approach.
  13. Benni Mack uploaded patch set 5 CR +1 V +1 06/03/25, 13:25

  14. core-ci voted on patch set 5 V +1 06/03/25, 13:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/79799

  15. Garvin Hicking commented on patch set 5 06/03/25, 13:59

    This works partially for me. As discussed with Benni yesterday, the following case is not yet covered (not sure whether we could address this in a follow-up, or here) Case in which "PHP Warning: Undefined array key "TYPO3\CMS\Scheduler\Task\OptimizeDatabaseTableTask" in /var/www/html/typo3-core/typo3/sysext/scheduler/Classes/Task/ExecuteSchedulableCommandAdditionalFieldProvider.php line 171" occurs: * Create scheduler task * Switch to "Optimize Table" * Select tables * Save * Switch back to a task without "tables", for example "UpdateExtensionList" This throws an error because the new task has no fields like "tables" but tries to access validation for the "previous" tasktype.
  16. Benni Mack commented on patch set 5 09/25/25, 13:49

    I think we can abandon this one. We removed the possibility to change task types
  17. Garvin Hicking abandoned the change 09/25/25, 14:14

    Yes! :-)