Project

General

Profile

Actions

Bug #82093

closed

Form Viewhelpers: Attribute errorClass not working

Added by Justus Moroni over 6 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Must have
Category:
Form Framework
Target version:
Start date:
2017-08-13
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
8
PHP Version:
7.1
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

It seems that the attribute "errorClass" in the fluid form viewhelpers is not working. The default "error" is not shown when an validation error is given.
The normal "ValidationResults" is detecting the errors with not problems.

With the newly releases beta of bootstrap 4 the framework changed the validation handling. This is no longer a class on the "form-group" element. The new method adds an class on the input,textarea oder select tag "is-invalid".
Therefore the functionality with "errorClass" would be perfect here.

The form extension uses the attribute in the partials as well. They are not working either.

Using the functionality of "ValidationResultsViewHelper" inside of "AbstractFormFieldViewHelper->setErrorClassAttribute" is not working either.

I'm not sure if this is an issue regarding the fluid viewhelpers or the form extension. Maybe both.

This behaviour can be seen when the core form extension is used in CMS 8.
Every form tag should've an class "error" on validation when the field is not valid.

I've detected this behaviour in using the "TYPO3\CMS\Fluid\ViewHelpers\Form\TextfieldViewHelper". Maybe this is working with other viewhelpers.

The files to check in are the following:
- typo3/sysext/form/Resources/Private/Frontend/Partials/Text.html > Line 8
- typo3/sysext/fluid/Classes/ViewHelpers/Form/TextfieldViewHelper.php > Line 89
- typo3/sysext/fluid/Classes/ViewHelpers/Form/AbstractFormFieldViewHelper.php > Line 317 - 335

The working validation viewhelper is the following:
- typo3/sysext/fluid/Classes/ViewHelpers/Form/ValidationResultsViewHelper.php

The working validation error detection can be found in the lines 96 - 99.


Files


Related issues 3 (0 open3 closed)

Related to TYPO3 Core - Bug #84175: Remove duplicate ReST fileClosed2018-03-08

Actions
Has duplicate TYPO3 Core - Task #82493: BUGFIX: Fix wrong error path of validationClosed2017-09-16

Actions
Is duplicate of TYPO3 Core - Bug #82248: Error class is not set on input fieldsClosed2017-08-30

Actions
Actions #1

Updated by Justus Moroni over 6 years ago

I've added an screenshot with the rendering of the form partial "Text".

Actions #3

Updated by Daniel Siepmann over 6 years ago

  • Priority changed from Should have to Must have
Actions #4

Updated by Gerrit Code Review over 6 years ago

  • Status changed from New 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/54150

Actions #5

Updated by Susanne Moog over 6 years ago

  • Has duplicate Task #82493: BUGFIX: Fix wrong error path of validation added
Actions #6

Updated by Gerrit Code Review over 6 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/54150

Actions #7

Updated by Gerrit Code Review over 6 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/54150

Actions #8

Updated by Johannes Hollmann over 6 years ago

I have tested the fix. The property elementErrorClassAttribute works now correctly.
But the fix brings another issue. Now the validationResults.errors and validationResults.flattenedErrors are not rendered in the fluid-templates

Actions #9

Updated by Ralf Zimmermann over 6 years ago

  • Assignee set to Ralf Zimmermann
Actions #10

Updated by Ralf Zimmermann about 6 years ago

  • Is duplicate of Bug #82248: Error class is not set on input fields added
Actions #11

Updated by Ralf Zimmermann about 6 years ago

  • Category changed from Fluid to Form Framework
Actions #12

Updated by Ralf Zimmermann about 6 years ago

  • Status changed from Under Review to Closed
Actions #13

Updated by Gerrit Code Review about 6 years ago

  • Status changed from Closed to Under Review

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/54150

Actions #14

Updated by Gerrit Code Review about 6 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/54150

Actions #15

Updated by Gerrit Code Review about 6 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/54150

Actions #16

Updated by Gerrit Code Review about 6 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/54150

Actions #17

Updated by Gerrit Code Review about 6 years ago

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

Actions #18

Updated by Gerrit Code Review about 6 years ago

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

Actions #19

Updated by Anonymous about 6 years ago

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

Updated by Oliver Hader about 6 years ago

  • Target version set to 8.7.11
Actions #21

Updated by Christian Kuhn about 6 years ago

  • Related to Bug #84175: Remove duplicate ReST file added
Actions #22

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF