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

Also available in: Atom PDF