Review 13.4 Merged

88224[BUGFIX] Handle file upload validation for empty argument

Georg Ringer CR +2 V +2 Normal +64 −3 updated 02/15/25, 08:56

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
  • Verified V +2 Done
    • Georg Ringer +2
    • core-ci +1 CI

Issues 1

Files 2

Review log 34

  1. Georg Ringer commented on patch set 1 02/15/25, 08:45

    Cherry Picked from branch main.
  2. core-ci voted on patch set 1 V +1 02/15/25, 08:51 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74171

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

  4. Georg Ringer merged patch set 2 02/15/25, 08:56