Bug #82093

Form Viewhelpers: Attribute errorClass not working

Added by Justus Moroni almost 4 years ago. Updated over 2 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

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
#1

Updated by Justus Moroni almost 4 years ago

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

#3

Updated by Daniel Siepmann almost 4 years ago

  • Priority changed from Should have to Must have
#4

Updated by Gerrit Code Review almost 4 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

#5

Updated by Susanne Moog over 3 years ago

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

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

#7

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

#8

Updated by Johannes Hollmann over 3 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

#9

Updated by Ralf Zimmermann over 3 years ago

  • Assignee set to Ralf Zimmermann
#10

Updated by Ralf Zimmermann over 3 years ago

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

Updated by Ralf Zimmermann over 3 years ago

  • Category changed from Fluid to Form Framework
#12

Updated by Ralf Zimmermann over 3 years ago

  • Status changed from Under Review to Closed
#13

Updated by Gerrit Code Review over 3 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

#14

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

#15

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

#16

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

#17

Updated by Gerrit Code Review over 3 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

#18

Updated by Gerrit Code Review over 3 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

#19

Updated by Anonymous over 3 years ago

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

Updated by Oliver Hader over 3 years ago

  • Target version set to 8.7.11
#21

Updated by Christian Kuhn over 3 years ago

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

Updated by Benni Mack over 2 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF