Review main Merged

90134[BUGFIX] Utilize DuplicationBehavior ENUM in EXT:form

Garvin Hicking CR +2 V +2 Easy +4 −3 updated 07/28/25, 16:06

Commit message

With the removal of nun-ENUM DuplicationBehavior values in
issue #105425 a leftover remained in the EXT:form
UploadedFileReferenceConverter. This was hard to spot
because it referenced only a "conflictMode" name instead
of "DuplicationBehavior".

With this patch the proper casting from a string to the
ENUM is performed, preventing a PHP TypeError when uploading
files through EXT:form:

```
TYPO3\CMS\Core\Resource\Folder::addUploadedFile(): Argument #2
($conflictMode) must be of type
TYPO3\CMS\Core\Resource\Enum\DuplicationBehavior, string given
```

Review

  • Code review CR +2 Done
    • Garvin Hicking +2
    • Christian Kuhn +1
    • Josua Vogel +1
  • Verified V +2 Done
    • Garvin Hicking +2
    • Christian Kuhn +1
    • Josua Vogel +1
    • core-ci +1 CI

Issues 4

Files 1

Review log 1215

  1. Garvin Hicking uploaded patch set 1 07/23/25, 20:56

  2. core-ci voted on patch set 1 V +1 07/23/25, 21:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/82194

  3. Josua Vogel commented on patch set 1 CR +1 V +1 07/24/25, 05:56

    It works, thank you very much.
  4. Simon Schaufelberger voted on patch set 1 CR +1 V +1 07/24/25, 09:00

  5. Andreas Kienast commented on patch set 1 CR -1 07/25/25, 06:18

    UploadedFileReferenceConverter.php:83

    Please use `DuplicationBehavior::RENAME` only...

    UploadedFileReferenceConverter.php:210

    ... to allow this: ```suggestion $conflictMode = DuplicationBehavior::tryFrom($configuration->getConfigurationValue(self::class, self::CONFIGURATION_UPLOAD_CONFLICT_MODE)) ?? $this->defaultConflictMode; ``` btw, do we have a validation that checks whether the configured conflict mode is valid?

    UploadedFileReferenceConverter.php:210

    Why do we fallback to _another_ default behavior (`cancel`)?
  6. Garvin Hicking uploaded patch set 2 CR +1 V +1 07/25/25, 07:58

  7. Garvin Hicking commented on patch set 2 07/25/25, 08:00

    UploadedFileReferenceConverter.php:83 Reply

    Done

    UploadedFileReferenceConverter.php:210 Reply

    Done. The "validation" would be the TypeError that would probably happen in case of mismatches. We could address this in a follow-up to first fix broken uploads with valid settings for now?

    UploadedFileReferenceConverter.php:210 Reply

    Done
  8. core-ci voted on patch set 2 V -1 07/25/25, 08:06 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/82306

  9. Andreas Kienast commented on patch set 2 07/25/25, 08:25

    UploadedFileReferenceConverter.php:210 Reply

    `tryFrom()` doesn't throw errors when passing an invalid value, hence the `try`. The existence of validation was just a question, not an order to implement it.
  10. Garvin Hicking commented on patch set 3 V -1 07/25/25, 15:32

    Published edit on patch set 2.
  11. core-ci voted on patch set 3 V +1 07/25/25, 15:40 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/82328

  12. Josua Vogel voted on patch set 3 CR +1 V +1 07/25/25, 15:52

  13. Christian Kuhn voted on patch set 3 CR +1 V +1 07/28/25, 16:02

  14. Garvin Hicking voted on patch set 3 CR +2 V +2 07/28/25, 16:06

  15. Garvin Hicking merged patch set 4 07/28/25, 16:06