Project

General

Profile

Actions

Bug #95095

closed

Properties of Extbase OriginalRequest get overwritten on forward

Added by Torben Hansen about 3 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
2021-09-03
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
11
PHP Version:
7.4
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Propably with the change #94428 the behavior of a ForwardRequest in Extbase changed. In TYPO3\CMS\Extbase\Mvc\Dispatcher::buildRequestFromCurrentRequestAndForwardResponse(Request $currentRequest, ForwardResponse $forwardResponse) the given $currentRequest is cloned to $request variable and next controller name, extension name and arguments get set for the cloned request object .

Since the cloned request object internally holds a reference to original the PSR-7 request, controller name, extension name and arguments actually get overwritten with data from the forwarded request.

To visualize this, please see the following screenshots.

This is the state right after $currentRequest is cloned to $request. Note, that arguments in ExtbaseRequestParameters contains 4 items.

This is the state of $currentRequest after controller name, extension name and arguments were changed in $request. So basically we loose important information about the original request here.

It seems to me, that this new behavior is unintended any may lead to problems for extension authors relying on data in OriginalRequest


Files

current-request-before.png (88.1 KB) current-request-before.png Torben Hansen, 2021-09-03 08:55
current-request-after.png (85.4 KB) current-request-after.png Torben Hansen, 2021-09-03 08:55

Related issues 3 (0 open3 closed)

Related to TYPO3 Core - Feature #94428: Extbase Request implements ServerRequestInterfaceClosed2021-06-29

Actions
Related to TYPO3 Core - Bug #94457: Always override new request arguments when forwardingClosedAlexander Schnitzler2021-07-01

Actions
Related to TYPO3 Core - Bug #95281: Form values from submitted data are missing when validation failsClosed2021-09-20

Actions
Actions

Also available in: Atom PDF