Review main Merged

87976[BUGFIX] Handle file upload validation for empty argument

Torben Hansen CR +2 V +2 Normal +64 −3 updated 10/31/25, 11:28

Commit message

If an extbase domain model only has one property of the type
`FileReference` or `ObjectStorage<FileReference>`, the extbase
`RequestBuilder` does not create an argument, if no file upload
is given in frontend context. The reason for this is, that an
empty input type=file field is not included in POST data.

Extbase file upload handling will validate properties with
a configured file upload by fetching the property value from
the argument. This validation however fails, when the argument
value is `null`, because `ObjectAccess::getPropertyPath` is
used to retrieve the property from a `null` value.

With this change, it is ensured, that the property value
is only resolved from the argument, if the argument is
not `null`. If the argument is `null`, the property value
is set to `null` too, ensuring that a file upload
property is correctly validated, if it is defined as
required.

Review

  • Code review CR +2 Done
    • Georg Ringer +2
    • Garvin Hicking +1
    • Simon Schaufelberger +1
  • Verified V +2 Done
    • Georg Ringer +2
    • Garvin Hicking +1
    • Simon Schaufelberger +1
    • core-ci +1 CI

Issues 1

Files 2

Review log 1316

  1. Torben Hansen uploaded patch set 1 02/01/25, 09:02

  2. core-ci voted on patch set 1 V +1 02/01/25, 09:08 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/73313

  3. Garvin Hicking voted on patch set 1 CR +1 02/01/25, 09:48

  4. Torben Hansen rebased onto patch set 2 CR +1 V +1 02/13/25, 08:54

  5. core-ci voted on patch set 2 V +1 02/13/25, 09:01 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74104

  6. Garvin Hicking voted on patch set 2 CR +1 V +1 02/13/25, 10:54

  7. Christian Kuhn commented on patch set 2 02/14/25, 12:50

    FileHandlingServiceConfiguration.php:143

    matter of taste: i personally tend to init $currentPropertyValue = null; before the if, then skip the else.
  8. Torben Hansen uploaded patch set 3 CR +1 V +1 02/14/25, 17:48

  9. Torben Hansen commented on patch set 3 02/14/25, 17:48

    FileHandlingServiceConfiguration.php:143 Reply

    Done
  10. core-ci voted on patch set 3 V +1 02/14/25, 17:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74154

  11. Garvin Hicking voted on patch set 3 CR +1 V +1 02/14/25, 18:02

  12. Simon Schaufelberger voted on patch set 3 CR +1 V +1 02/14/25, 19:49

  13. Georg Ringer voted on patch set 3 CR +2 V +2 02/15/25, 08:44

  14. Georg Ringer merged patch set 4 02/15/25, 08:45

  15. Stephan Großberndt commented on patch set 4 10/31/25, 09:07

    This change has 'Releases: main, 13.4', but the backport to 13.4 is missing.
  16. Garvin Hicking commented on patch set 4 10/31/25, 11:28

    Reply

    The relation is lost, the commit is this: https://review.typo3.org/c/Packages/TYPO3.CMS/+/88224