Project

General

Profile

Actions

Bug #86890

closed

AbstractTagBasedViewHelper recycles the TagBuilder

Added by Steffen Keuper about 6 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Fluid
Target version:
-
Start date:
2018-11-08
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
9
PHP Version:
7.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

The same ViewHelper instance is used for multiple generations of Tags in \TYPO3Fluid\Fluid\Core\ViewHelper\AbstractTagBasedViewHelper.
This causes arguments like required to get set in the generated HTML even though it wasn't set in the ViewHelper call.
As a result I'm getting required fields which shouldn't be required and aren't marked like required either.

Screenshot of the var_dump of $this->tag directly at the top of the render function in the TextfieldViewHelper:

It only occurred in 30-50% of the cases when I first accessed the page after clearing the cache in the Install Tool for which I have no possible explanation.

I made a simple test form to reproduce this bug(form fields after the first required field also get the required tag even though they may not be required):


renderingOptions:
  submitButtonLabel: Submit
type: Form
identifier: testForm
label: 'Test Form'
prototypeName: standard
renderables:
  -
    renderingOptions:
      previousButtonLabel: 'Previous step'
      nextButtonLabel: 'Next step'
    type: Page
    identifier: page-1
    label: Step
    renderables:
      -
        type: GridRow
        identifier: gridrow-1
        label: 'Grid: Row'
        renderables:
          -
            defaultValue: ''
            type: Text
            identifier: text-1
            label: 'Text 1'
            validators:
              -
                identifier: NotEmpty
            properties:
              fluidAdditionalAttributes:
                required: required
                placeholder: 'text 1'
          -
            defaultValue: ''
            type: Text
            identifier: text-2
            label: Text
            properties:
              fluidAdditionalAttributes:
                placeholder: 'text 2'
      -
        type: GridRow
        identifier: gridrow-2
        label: 'Grid: Row'
        renderables:
          -
            defaultValue: ''
            type: Text
            identifier: text-3
            label: Text
            properties:
              fluidAdditionalAttributes:
                placeholder: 'text 3'
          -
            defaultValue: ''
            type: Text
            identifier: text-4
            label: Text
            properties:
              fluidAdditionalAttributes:
                placeholder: 'text 4'
                required: required
            validators:
              -
                identifier: NotEmpty
      -
        type: GridRow
        identifier: gridrow-3
        label: 'Grid: Row'

I also couldn't reproduce the bug directly with Fluid templates which is why I decided to use the Form Framework Category.


Related issues 5 (0 open5 closed)

Related to TYPO3 Core - Bug #87586: ext:form field properties get inherited to subsequent fieldsClosed2019-01-30

Actions
Related to TYPO3 Core - Bug #87811: EXT:form makes all fields requiredClosed2019-02-28

Actions
Related to TYPO3 Core - Bug #86164: CheckboxViewHelper sets automatically each checkbox on checked, if just one of them is checkedClosed2018-09-06

Actions
Has duplicate TYPO3 Core - Bug #86910: All text input fields get required="required" attributeClosed2018-11-12

Actions
Has duplicate TYPO3 Core - Bug #87430: Fields which are not required render with required attributeClosed2019-01-14

Actions
Actions

Also available in: Atom PDF