Bug #77097

[__referrer][@request] is set only for the first form, when forms are generated in a f:for loop

Added by Viktor Livakivskyi over 3 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Fluid
Start date:
2016-07-14
Due date:
% Done:

100%

TYPO3 Version:
7
PHP Version:
5.6
Tags:
Complexity:
Is Regression:
Yes
Sprint Focus:
On Location Sprint

Description

Hi,

There is an issue with setting hidden referrer request field. When a form is placed standalone in a template, it contains a [__referrer][@request] in it. However, when a form is placed in a loop, only the first form contains referring request field.

Consider a following example:

<f:form action="anything" name="license" enctype="multipart/form-data">
    <f:form.textarea />
    <f:form.submit value="{f:translate(key: 'submit')}" />
</f:form>

<f:form action="anything" name="license" enctype="multipart/form-data">
    <f:form.textarea />
    <f:form.submit value="{f:translate(key: 'submit')}" />
</f:form>

<f:for each="{0: 'zero', 1: 'one'}" as="something">
    <f:form action="anything" name="license" enctype="multipart/form-data">
        <f:form.textarea />
        <f:form.submit value="{f:translate(key: 'submit')}" />
    </f:form>
</f:for>

Resulting output:
Form 1: contains [__referrer][@request], because is placed standalone.
Form 2: contains [__referrer][@request], because is placed standalone.
Form 3: contains [__referrer][@request], because is first in a loop.
Form 4: doesn't contain [__referrer][@request], because is second in a loop.

This results in different behavior in case of validation errors. First form from a loop will show validation errors at current page, while all the next forms will open resulting page and show a generic error message, like Validation failed while trying to call Vendor\Extensions\Controller\MyController->anythingAction().

TYPO3 7.6.9
Plugin's actions (both: the one that shows a forms, and the one that is used as form's target) are non-cacheable.


Related issues

Related to TYPO3 Core - Bug #78551: Second form in template doesn't render hidden field for checkbox Closed 2016-11-03

Associated revisions

Revision 1d2ee7ab (diff)
Added by Helmut Hummel about 3 years ago

[BUGFIX] Reset FormViewHelper on execution

This commit ensures that the FormViewHelper is in a clean state and
can render the required hidden fields (again).

Resolves: #77097
Releases: master, 7.6, 6.2
Change-Id: I82f90ee7c0aaf44cd48a9abde6dbb012f536543e
Reviewed-on: https://review.typo3.org/49104
Tested-by: TYPO3com <>
Reviewed-by: Nicole Cordes <>
Reviewed-by: Stefan Neufeind <>
Tested-by: Stefan Neufeind <>
Reviewed-by: Markus Sommer <>
Tested-by: Markus Sommer <>
Reviewed-by: Anja Leichsenring <>
Tested-by: Anja Leichsenring <>

Revision 3d01057f (diff)
Added by Helmut Hummel about 3 years ago

[BUGFIX] Reset FormViewHelper on execution

This commit ensures that the FormViewHelper is in a clean state and
can render the required hidden fields (again).

Resolves: #77097
Releases: master, 7.6, 6.2
Change-Id: I82f90ee7c0aaf44cd48a9abde6dbb012f536543e
Reviewed-on: https://review.typo3.org/50847
Reviewed-by: Anja Leichsenring <>
Tested-by: Anja Leichsenring <>

Revision b4aceeaa (diff)
Added by Anja Leichsenring about 3 years ago

[FOLLOWUP][BUGFIX] Reset FormViewHelper on execution

Incomplete backport caused unit tests to fail.

Change-Id: Ib447b2327c5c54956d86149c08c503d9a463c2b4
Resolves: #77097
Releases: 7.6
Reviewed-on: https://review.typo3.org/50849
Tested-by: TYPO3com <>
Reviewed-by: Jan Helke <>
Tested-by: Jan Helke <>
Reviewed-by: Susanne Moog <>
Tested-by: Susanne Moog <>

Revision b927c7be (diff)
Added by Helmut Hummel about 3 years ago

[BUGFIX] Reset FormViewHelper on execution

This commit ensures that the FormViewHelper is in a clean state and
can render the required hidden fields (again).

Resolves: #77097
Releases: master, 7.6, 6.2
Change-Id: I82f90ee7c0aaf44cd48a9abde6dbb012f536543e
Reviewed-on: https://review.typo3.org/50848
Tested-by: TYPO3com <>
Reviewed-by: Markus Sommer <>
Tested-by: Markus Sommer <>
Reviewed-by: Gleb Levitin <>
Tested-by: Gleb Levitin <>
Reviewed-by: Anja Leichsenring <>
Tested-by: Anja Leichsenring <>

History

#1 Updated by Nicole Cordes over 3 years ago

  • Assignee set to Nicole Cordes

#2 Updated by Nicole Cordes over 3 years ago

  • Sprint Focus set to On Location Sprint

#3 Updated by Oliver Hader over 3 years ago

I did not test this issue, but if it's reproducible it would be a regression

#4 Updated by Markus Friedrich over 3 years ago

If you disable caching, this error doesn't occur, but you can simply reproduce it with activated caching, the following TypoScript and by using the given fluid template:

page = PAGE
page.10 = FLUIDTEMPLATE
page.10.file = <path_to_file_with_given_fluid_code>

#5 Updated by Nicole Cordes over 3 years ago

  • Status changed from New to Accepted
  • Assignee deleted (Nicole Cordes)
  • Is Regression changed from No to Yes

#6 Updated by Gerrit Code Review over 3 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/49104

#7 Updated by Gerrit Code Review over 3 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/49104

#8 Updated by Gerrit Code Review over 3 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/49104

#9 Updated by Gerrit Code Review over 3 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/49104

#10 Updated by Gerrit Code Review over 3 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/49104

#11 Updated by Gerrit Code Review over 3 years ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/49104

#12 Updated by Daniel Goerz about 3 years ago

  • Target version set to Candidate for patchlevel

#13 Updated by Gerrit Code Review about 3 years ago

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/49104

#14 Updated by Gerrit Code Review about 3 years ago

Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/49104

#15 Updated by Gerrit Code Review about 3 years ago

Patch set 1 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/50847

#16 Updated by Anonymous about 3 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#17 Updated by Gerrit Code Review about 3 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/50848

#18 Updated by Gerrit Code Review about 3 years ago

Patch set 1 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/50849

#19 Updated by Gerrit Code Review about 3 years ago

Patch set 2 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/50848

#20 Updated by Gerrit Code Review about 3 years ago

Patch set 3 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/50848

#21 Updated by Anja Leichsenring about 3 years ago

  • Status changed from Under Review to Resolved

#22 Updated by Benni Mack about 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF