Project

General

Profile

Actions

Bug #95281

closed

Form values from submitted data are missing when validation fails

Added by Frederik Schaller about 3 years ago. Updated about 2 years ago.

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

0%

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

Description

Hi,

During tests with our extension and TYPO3 v11.4 we have identified a bug that already entered data in a from is missing when the validation fails and the ErrorAction triggers a ForwardResponse.

The ViewHelper method getValueAttribute looks for already submitted form data. I've found out that the OriginalRequest ($this->renderingContext->getRequest()->getOriginalRequest()->getArguments()) did not had any of the entered data.

When looking into the Dispatchers.php the method buildRequestFromCurrentRequestAndForwardResponse clones the $currentRequest into the $request variable.

        $request = clone $currentRequest;

...

        if ($forwardResponse->getArguments() !== null) {
            $request->setArguments($forwardResponse->getArguments());
        }

I recognised that the setArguments method on the $request arguments does also change the $currentRequest object, which results in loosing the OriginalRequests payload. I assume that this is the reason, why the getValueAttribute does not find any values and does not enrich the form.

For testing purposes I've commented out

<!--
        if ($forwardResponse->getArguments() !== null) {
            $request->setArguments($forwardResponse->getArguments());
        }
-->

This leads to a new behaviour because the initial action gets now an invalidated object (which is fine) but was not the case with TYPO v10 (the model was there NULL).

Thanks for looking into this.
Frederik


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #95095: Properties of Extbase OriginalRequest get overwritten on forwardClosed2021-09-03

Actions
Actions #1

Updated by Torben Hansen about 3 years ago

  • Related to Bug #95095: Properties of Extbase OriginalRequest get overwritten on forward added
Actions #2

Updated by Torben Hansen about 3 years ago

Does this patch https://review.typo3.org/c/Packages/TYPO3.CMS/+/71133 resolve your problem?

Actions #3

Updated by Frederik Schaller about 3 years ago

Torben Hansen wrote in #note-2:

Does this patch https://review.typo3.org/c/Packages/TYPO3.CMS/+/71133 resolve your problem?

Yes. Thank you very much!

Actions #4

Updated by Benni Mack about 3 years ago

  • Target version changed from 11 LTS to Candidate for patchlevel
Actions #5

Updated by Christian Kuhn over 2 years ago

  • Status changed from New to Resolved

resolved with #95095

Actions #6

Updated by Benni Mack about 2 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF