73868[!!!][TASK] Get rid of $_FILES in extbase
Commit message
Review
-
Code review CR +2 Done
- Benni Mack +2
- Stefan Bürk +1
-
Verified V +2 Done
- Benni Mack +2
- Stefan Bürk +1
- core-ci +1 CI
Issues 1
Files 10
- Build/phpstan/phpstan-baseline.neon+1 −1
- typo3/sysext/core/Classes/Http/ServerRequestFactory.php+4 −2
- typo3/sysext/core/Classes/Http/UploadedFile.php3+23 −0
- typo3/sysext/core/Classes/Resource/ResourceStorage.php3+20 −9
- typo3/sysext/core/Documentation/Changelog/12.0/Breaking-97214-UseUploadedFileObjectsInsteadOf_FILES.rstnew+68 −0
- typo3/sysext/extbase/Classes/Mvc/Web/RequestBuilder.php6+51 −71
- typo3/sysext/extbase/Classes/Mvc/ExtbaseRequestParameters.php+38 −0
- typo3/sysext/extbase/Classes/Mvc/Request.php+4 −3
- typo3/sysext/extbase/Tests/Functional/Mvc/Web/RequestBuilderTest.php+60 −10
- typo3/sysext/extensionmanager/Classes/Controller/UploadExtensionFileController.php8+17 −12
Review log 4156
Show 1931 earlier messages
-
Susi Moog uploaded patch set 1 03/10/22, 11:28
-
core-ci voted on patch set 1 V -1 03/10/22, 11:40 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/24788
-
Susi Moog uploaded patch set 2 03/10/22, 11:52
-
core-ci voted on patch set 2 V -1 03/10/22, 12:04 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/24789
-
Susi Moog uploaded patch set 3 03/10/22, 13:28
-
core-ci voted on patch set 3 V -1 03/10/22, 13:45 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/24797
-
Susi Moog uploaded patch set 4 03/10/22, 14:51
-
core-ci voted on patch set 4 V -1 03/10/22, 14:58 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/24798
-
Susi Moog uploaded patch set 5 03/14/22, 07:57
-
core-ci voted on patch set 5 V -1 03/14/22, 08:12 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/24865
-
Susi Moog uploaded patch set 6 03/14/22, 11:23
-
core-ci voted on patch set 6 V -1 03/14/22, 11:30 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/24872
-
Stefan Bürk uploaded patch set 7 03/15/22, 09:55
-
Stefan Bürk uploaded patch set 8 03/15/22, 10:01
-
core-ci voted on patch set 7 V -1 03/15/22, 10:10 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/24903
-
core-ci voted on patch set 8 V +1 03/15/22, 10:20 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/24904
-
Susi Moog commented on patch set 8 03/15/22, 10:39
@stefan thanks a lot! -
Susi Moog uploaded patch set 9 03/20/22, 08:47
-
core-ci voted on patch set 9 V +1 03/20/22, 08:55 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25004
-
Susi Moog uploaded patch set 10 04/05/22, 06:39
-
Susi Moog marked it ready for review 04/05/22, 06:42
-
core-ci voted on patch set 10 V +1 04/05/22, 06:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25466
-
Benni Mack commented on patch set 11 04/05/22, 16:53
Published edit on patch set 10. -
core-ci voted on patch set 11 V +1 04/05/22, 17:01 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25546
-
Benni Mack voted on patch set 11 V +1 CR +1 04/05/22, 17:03
-
Andreas Kienast commented on patch set 11 CR -1 04/06/22, 07:48
on it -
Andreas Kienast uploaded patch set 12 04/06/22, 08:05
-
Daniel Goerz commented on patch set 12 CR +1 04/06/22, 08:12
Looks very promising!UploadedFile.php:29Do we have to keep this @internal? -
core-ci voted on patch set 12 V +1 04/06/22, 08:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25583
-
Stefan Bürk commented on patch set 12 04/06/22, 23:01
ResourceStorage.php:2120Are there planes to remove other `$_FILES[]` global usages too (kind of small epic) ? For example: * ExtendedFileUtility->replaceFile([...]) * DataHandler operations etc ? Then it would make sense to add at least here a @todo that `array` type should be deprecated after core usages are fully streamlined - or speaks something against it ? -
Simon Schaufelberger commented on patch set 12 04/07/22, 00:33
UploadExtensionFileController.php:95can we document this somewhere so that people know how to use this feature?
-
Stefan Bürk commented on patch set 12 04/07/22, 06:21
UploadExtensionFileController.php:95ReplyI think a short example in Migration of the breaking-rst could be added. -
Susi Moog commented on patch set 12 04/08/22, 07:43
UploadedFile.php:29ReplyAt the moment I would leave it as internal at least during the v12 development phase so we can make sure that we have everything we need before we make it public API.ResourceStorage.php:2120ReplyAt the moment, my plans are "just" about extbase and providing an API for handling uploads there, if we want to do this for every $_FILES usage, we should have an ApI for that.UploadExtensionFileController.php:95ReplyI'll add one, thanks for the suggestion :) -
Susi Moog uploaded patch set 13 04/08/22, 08:01
-
core-ci voted on patch set 13 V -1 04/08/22, 08:11 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25810
-
Susi Moog uploaded patch set 14 04/08/22, 08:18
-
core-ci voted on patch set 14 V +1 04/08/22, 08:29 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25811
-
Andreas Kienast uploaded patch set 15 04/08/22, 08:37
-
core-ci voted on patch set 15 V +1 04/08/22, 08:46 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25816
-
Benni Mack commented on patch set 15 04/09/22, 19:46
ResourceStorage.php:2120Reply -
Benni Mack voted on patch set 15 V +1 CR +1 04/11/22, 21:03
-
Stefan Bürk voted on patch set 15 CR -1 04/11/22, 21:11
-
Stefan Bürk voted on patch set 15 V +1 CR +1 04/11/22, 21:28
-
Stefan Bürk commented on patch set 15 04/11/22, 21:29
UploadedFile.php:29ReplyDone -
Benni Mack commented on patch set 15 V +2 CR +2 04/11/22, 22:31
UploadExtensionFileController.php:95ReplyDone -
Benni Mack merged patch set 16 04/11/22, 22:31
-
Simon Schaufelberger commented on patch set 16 04/11/22, 23:02
UploadExtensionFileController.php:95Reply@Benni, not really. The example in the REST file is for the ResourceStorage, not for an actual extbase plugin. For an extbase plugin you need this line: $file = $this->request->getUploadedFiles()['extensionFile'] ?? null; -
Benni Mack commented on patch set 16 04/12/22, 11:27
UploadExtensionFileController.php:95ReplySorry, misread this, Will do a followup. -
Susi Moog commented on patch set 16 04/12/22, 15:39
UploadExtensionFileController.php:95ReplyExtbase still provides the uploaded file(s) as arguments, same as before - which is probably the documented way of using it; the extension manager however never really used that, so I did the least intrusive thing in this case, I'm unsure if we should recommend that though. -
Benni Mack commented on patch set 16 04/17/22, 12:40
UploadExtensionFileController.php:95ReplyThought about it a bit more: I think what we need is proper TypeConverters (one for persisting and one for "on-the-fly") that TYPO3 ships in Extbase, which are based on PSR-7 in the future. This then needs to be documented once we have the type converters. Issue is already available and could be continued now https://forge.typo3.org/issues/5718 -
Andreas Kienast commented on patch set 16 03/31/23, 09:49
post -1: regression in EXT:formRequestBuilder.php:206This line breaks the file upload in EXT:form. -
Christian Kuhn commented on patch set 16 07/31/23, 11:25
RequestBuilder.php:206Replyfixed with https://review.typo3.org/c/Packages/TYPO3.CMS/+/78336 i suppose?! -
Andreas Kienast commented on patch set 16 07/31/23, 11:50
RequestBuilder.php:206ReplyYes -
Daniel Goerz commented on patch set 16 08/07/23, 08:29
RequestBuilder.php:206ReplyI dont think the EXT:form patch is the "correct" fix. We should do the array_merge_recursive in the extbase RequestBuilder instead to have the uploaded files also available as arguments in the ActionController, so that we can map them on object properties via PropertyMapper. Or is there some reason for not doing that here? -
Torben Hansen commented on patch set 16 10/30/23, 09:35
RequestBuilder.php:206ReplyI agree with Daniel, that the ext:form patch is not "correct". It fixes the problem for the ext:form scenario, but leaves out, that the uploaded files are not merged into the extbase arguments anymore. This basically results in, that currently every 3rd party code using on a custom `UploadFileReferenceConverter` (or even using the ext:form TypeConverter directly - which is discouraged) will not work, since uploaded files are not available for the property mapper and type conversion/file upload is non functional. Created an issue for this: https://forge.typo3.org/issues/102283 -
Stefan Froemken commented on patch set 16 01/17/24, 13:02
RequestBuilder.php:206Reply UnresolvedThe count() comes from line 316 of old version. But it's only there, if a file was uploaded with just a property name like "image" insteadof "tx_events2_event.event.images.0". For me this issue is already solved with lines 198-201 here in new version. So, yes, the count() === 1 line has to be removed.