Bug #82093
closedForm Viewhelpers: Attribute errorClass not working
100%
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
Updated by Justus Moroni over 7 years ago
I've added an screenshot with the rendering of the form partial "Text".
Updated by Justus Moroni over 7 years ago
Here are the documentations for this functionality.
Fluid Viewhelpers:
- https://docs.typo3.org/typo3cms/ExtbaseGuide/Fluid/ViewHelper/Form/Textfield.html#errorclass
Updated by Daniel Siepmann about 7 years ago
- Priority changed from Should have to Must have
Updated by Gerrit Code Review about 7 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
Updated by Susanne Moog about 7 years ago
- Has duplicate Task #82493: BUGFIX: Fix wrong error path of validation added
Updated by Gerrit Code Review about 7 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
Updated by Gerrit Code Review about 7 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
Updated by Johannes Hollmann about 7 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
Updated by Ralf Zimmermann over 6 years ago
- Is duplicate of Bug #82248: Error class is not set on input fields added
Updated by Ralf Zimmermann over 6 years ago
- Category changed from Fluid to Form Framework
Updated by Ralf Zimmermann over 6 years ago
- Status changed from Under Review to Closed
Updated by Gerrit Code Review over 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
Updated by Gerrit Code Review over 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
Updated by Gerrit Code Review over 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
Updated by Gerrit Code Review over 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
Updated by Gerrit Code Review over 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
Updated by Gerrit Code Review over 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
Updated by Anonymous over 6 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset b3190c3b8eb2b45f369ace8a67f417e147e41977.
Updated by Christian Kuhn over 6 years ago
- Related to Bug #84175: Remove duplicate ReST file added