Project

General

Profile

Actions

Bug #102361

closed

form multiple breaks RequestParameters

Added by Philipp Parzer about 1 year ago. Updated 4 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
2023-11-10
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
12
PHP Version:
8.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

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


Related issues 3 (0 open3 closed)

Related to TYPO3 Core - Bug #102271: Broken backwards compatibility in request builder for file uploads as object propertyClosed2023-10-27

Actions
Related to TYPO3 Core - Bug #100983: Problem with file upload in extbase formClosed2023-06-09

Actions
Has duplicate TYPO3 Core - Bug #102364: RequestBuilder::build unnesting $fileParameters one level to muchClosed2023-11-12

Actions
Actions #1

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.

Actions #2

Updated by Garvin Hicking 12 months ago

  • Has duplicate Bug #102364: RequestBuilder::build unnesting $fileParameters one level to much added
Actions #3

Updated by Andreas Wolf 8 months ago

  • Related to Bug #102271: Broken backwards compatibility in request builder for file uploads as object property added
Actions #4

Updated by Andreas Wolf 8 months ago

  • Related to Bug #100983: Problem with file upload in extbase form added
Actions #5

Updated by Andreas Wolf 8 months ago

This was fixed in main already, see #102271. Should still be fixed for v12 IMO.

Actions #6

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.

Actions #7

Updated by Georg Ringer 5 months ago

  • Status changed from New to Resolved

this has been fixed for v12 with #102271

Actions #8

Updated by Benni Mack 4 months ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF