Project

General

Profile

Actions

Bug #77097

closed

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

Added by Viktor Livakivskyi almost 8 years ago. Updated over 5 years ago.

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

100%

Estimated time:
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 1 (0 open1 closed)

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

Actions
Actions

Also available in: Atom PDF