Bug #102361
closedform multiple breaks RequestParameters
0%
Description
When using
<f:form.upload name="files" multiple="true" class="form-control" />
in a Backend Module, the request breaks because of
Argument #1 ($argumentName) must be of type string, int given
Solution - cast $argumentName to (string) in
https://github.com/TYPO3/typo3/blob/main/typo3/sysext/extbase/Classes/Mvc/Web/RequestBuilder.php#L147
Updated by David Blatter 12 months ago
The problem seems to come from here: https://github.com/TYPO3/typo3/blob/e3f666cd9c1157bb27edda363807ab05f047bf20/typo3/sysext/extbase/Classes/Mvc/Web/RequestBuilder.php#L131-L145
Line 143 breaks the array if you have only one file input. I suspect it was introduced to undo line 135. But that one will not be executed normally. If we have an UploadedFile instance on line 135, wouldn't that come from a file input with name="tx_myext_myplugin". That would be odd. I would argue, that such a input parameter shouldn't make it into the extbase request object in the first place. So I would change line 137 to $files = [];
and remove the lines 142 - 144.
Updated by Garvin Hicking 12 months ago
- Has duplicate Bug #102364: RequestBuilder::build unnesting $fileParameters one level to much added
Updated by Andreas Wolf 8 months ago
- Related to Bug #102271: Broken backwards compatibility in request builder for file uploads as object property added
Updated by Andreas Wolf 8 months ago
- Related to Bug #100983: Problem with file upload in extbase form added
Updated by Andreas Wolf 8 months ago
This was fixed in main already, see #102271. Should still be fixed for v12 IMO.
Updated by Andreas Wolf 8 months ago
During a session at T3CMD24 we realized that this behaviour actually comes from the backwards compatibility layer introduced in #97214; that layer was removed for main, but in v12, some people might rely on it now since v12 was released quite a while ago. Therefore, I personally would not fix it anymore to prevent breaking instances with a patchlevel release.
Updated by Georg Ringer 5 months ago
- Status changed from New to Resolved
this has been fixed for v12 with #102271