Commit 5932bdbd authored by Alexander Schnitzler's avatar Alexander Schnitzler Committed by Benni Mack
Browse files

[BUGFIX] Always override new request arguments when forwarding

Issue #92815 introduced a regression which triggered an endless
recursion in case of a validation error.

A bit longer explanation:

Given there is an extbase controller action with an argument
whose properties have to validated, extbase maps the incoming
data of the request onto the internally handled arguments
object which then performs the validation on all given arguments.

In case of an error, extbase tries to redirect to the referring
request aka the current request with an updated set of arguments.
The idea is to remove all arguments of the current request to not
trigger the same validation error again on the next try.

There was a condition in the past which eventually led to the
overriding of current arguments which was refactored wrong.

The solution is to simply always use the arguments of the
ForwardResponse.

Releases: master
Resolves: #94457
Change-Id: I9ec815205481faf77ff30eef3b5d68eb00c776c4
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/69680


Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
parent ce24ce8f
......@@ -160,9 +160,7 @@ class Dispatcher implements SingletonInterface
$request->setControllerExtensionName($forwardResponse->getExtensionName());
}
if ($forwardResponse->getArguments() !== []) {
$request->setArguments($forwardResponse->getArguments());
}
$request->setArguments($forwardResponse->getArguments());
$request->setOriginalRequest($currentRequest);
$request->setOriginalRequestMappingResults($forwardResponse->getArgumentsValidationResult());
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment