Project

General

Profile

Actions

Bug #102361

open

form multiple breaks RequestParameters

Added by Philipp Parzer 6 months ago. Updated about 1 month ago.

Status:
New
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 (2 open1 closed)

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

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

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

Actions
Actions #1

Updated by David Blatter 5 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 5 months ago

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

Updated by Andreas Wolf about 1 month ago

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

Updated by Andreas Wolf about 1 month ago

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

Updated by Andreas Wolf about 1 month ago

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

Actions #6

Updated by Andreas Wolf about 1 month 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

Also available in: Atom PDF