Review main Merged

79477[TASK] Allow PSR-7 UploadedFile in Folder->addUploadedFile()

Stephan Großberndt CR +2 V +2 Easy +25 −16 updated 01/13/25, 16:08

Commit message

It is now possible to add a PSR-7 UploadedFileInterface with
Folder->addUploadedFile() as already allowed when using
ResourceStorage->addUploadedFile().

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Stefan Bürk +1
    • Christian Kuhn +1
  • Verified V +2 Done
    • Benni Mack +2
    • Stefan Bürk +1
    • Christian Kuhn +1
    • core-ci +1 CI

Issues 2

Files 3

Review log 1924

  1. Stephan Großberndt uploaded patch set 1 06/21/23, 23:17

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

  3. Benni Mack commented on patch set 1 CR -1 06/23/23, 07:14

    We should use the actual PSR-7 object interface "Psr\Http\Message\UploadedFileInterface"
  4. Stephan Großberndt commented on patch set 1 06/26/23, 09:59

    Only for Folder/InaccessibleFolder or for ResourceStorage as well? Because that would lead to issues in the ResourceStorage::addUploadedFile() code as this depends on $uploadedFileData->getTemporaryFileName() which is only part of UploadedFile, but not UploadedFileInterface. Also https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/12.0/Breaking-97214-UseUploadedFileObjectsInsteadOf_FILES.html#migration must be adapted then? What about * https://git.typo3.org/typo3/typo3/-/blob/main/typo3/sysext/extbase/Classes/Mvc/Web/RequestBuilder.php#L125 * https://git.typo3.org/typo3/typo3/-/blob/main/typo3/sysext/form/Classes/Mvc/Property/TypeConverter/UploadedFileReferenceConverter.php#L137
  5. Benni Mack voted on patch set 1 CR +1 07/04/23, 07:35

  6. Susi Moog voted on patch set 1 CR +1 07/06/23, 19:23

  7. Frank Nägler voted on patch set 1 CR +1 07/06/23, 19:27

  8. Stefan Bürk rebased onto patch set 2 CR +1 V +1 09/27/23, 15:12

  9. core-ci voted on patch set 2 V +1 09/27/23, 15:22 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/47252

  10. Benni Mack uploaded patch set 3 V +1 01/13/25, 10:56

  11. core-ci voted on patch set 3 V +1 01/13/25, 11:03 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/72311

  12. Benni Mack updated the commit message in patch set 4 V +1 01/13/25, 14:09

  13. Benni Mack voted on patch set 4 CR +1 V +1 01/13/25, 14:10

  14. core-ci voted on patch set 4 V +1 01/13/25, 14:16 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/72354

  15. Stephan Großberndt voted on patch set 4 CR +1 01/13/25, 14:42

  16. Christian Kuhn commented on patch set 4 CR -1 01/13/25, 14:57

    sound good, taking a closer look now.
  17. Christian Kuhn commented on patch set 4 01/13/25, 15:24

    Folder.php:303

    Return hint can be "FileInterface" here, can it? There is no point in "File|FileInterface" since File implements FileInterface and a test for "additional" stuff File provides needs checks within consuming code anyway, hinting both adds no value. i guess the idea to declare both comes from addFile() annotating File as return, but that annotation is fishy and should probably go with FileInterface as well (there are tons of fishy return hints, phpstan agrees in this area and trying to fix these quite immediately turns into a can of worms, so lets be precise here if we can).
  18. Christian Kuhn uploaded patch set 5 CR +1 V +1 01/13/25, 15:36

  19. Christian Kuhn commented on patch set 5 01/13/25, 15:42

    Folder.php:303 Reply

    Done
  20. Christian Kuhn voted on patch set 5 CR +1 V +1 01/13/25, 15:43

  21. core-ci voted on patch set 5 V +1 01/13/25, 15:44 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/72362

  22. Stefan Bürk voted on patch set 5 CR +1 V +1 01/13/25, 15:44

  23. Benni Mack voted on patch set 5 CR +2 V +2 01/13/25, 16:08

  24. Benni Mack merged patch set 6 01/13/25, 16:08