Review main Merged

96805[BUGFIX] Keep defVals after rejected new record

Garvin Hicking CR +2 V +2 Normal +99 −9 updated 10/19/26, 09:04

Commit message

When a DataHandler hook rejects a new record, the edit form is reloaded
with its default values ("defVals"), as these may carry the record
type. A new scheduler task, for example, would otherwise come back
without its task type.

The check for such an unpersisted record looked for "NEW" in the keys
of the edit configuration. These keys hold the page id of a new record
though, "NEW" never occurs there, so the default values were always
dropped. The check now looks for the "new" command instead.

As "Save & New" also leaves a "new" command in the edit configuration,
the default values are now kept there as well, so the next new record
starts with the same defaults, such as the record type.

The bug can easily be reproduced by creating a task of type
"System Status Update" and entering "no" as email address. That
passes FormEngine validation (....sigh...), but fails server-side.
With patch: Proper error message, default type and inputs now available
Without patch: Unhelpful error message "Invalid Task type:", input
               form that no longer can be saved due to missing type.

Review

  • Code review CR +2 Done
    • Garvin Hicking +2
    • Oli Bartsch +1
  • Verified V +2 Done
    • Garvin Hicking +2
    • Oli Bartsch +1
    • core-ci +1 CI

Issues 2

Files 3

Review log 69

  1. Garvin Hicking uploaded patch set 1 10/17/26, 21:05

  2. Garvin Hicking updated the commit message in patch set 2 10/17/26, 21:08

  3. core-ci voted on patch set 2 V +1 10/17/26, 21:19 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111487

  4. core-ci voted on patch set 1 V +1 10/17/26, 21:20 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111486

  5. Oli Bartsch uploaded patch set 3 V +1 10/19/26, 07:17

  6. core-ci voted on patch set 3 V +1 10/19/26, 07:25 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111585

  7. Oli Bartsch voted on patch set 3 CR +1 V +1 10/19/26, 07:32

  8. Garvin Hicking voted on patch set 3 CR +2 V +2 10/19/26, 08:00

  9. Garvin Hicking merged patch set 4 10/19/26, 09:04