Bug #89236
closedTYPO3 Forms Extension: Required - Indicators (*) are not shown
0%
Description
There is a bug in the typo3 form Plugin in Version 9.5 (File: Resources/Private/Frontend/Partials/Field/Field.html):
<label class="control-label" for="{element.uniqueIdentifier}">{formvh:translateElementProperty(element: element, property: 'label')}<f:if ="{element.required}"><f:render partial="Field/Required" /></f:if></label>
The condition {element.required} is never met and the required - indicator (*) is never displayed.
The correct condition is {element.properties.fluidAdditionalAttributes.required}:
<label class="control-label" for="{element.uniqueIdentifier}">{formvh:translateElementProperty(element: element, property: 'label')}<f:if condition="{element.properties.fluidAdditionalAttributes.required}"><f:render partial="Field/Required" /></f:if></label>
There are more places (Templates) where {element.required} is used
There is an image attached to this issue that shows the <f:debug>{element}</f:debug> at the field.html.
Files
Updated by Michael Stucki about 5 years ago
- Project changed from 9 to TYPO3 Core
- Category deleted (
Development) - TYPO3 Version set to 10
Updated by Ralf Zimmermann about 5 years ago
`{element.required}` is a form element API (https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/form/Classes/Domain/Model/FormElements/AbstractFormElement.php#L129) which checks for the existance of the `NotEmptyValidator`.
Can you provide your full form definition? Did the `NotEmptyValidator` exists within your form element?
Updated by Ralf Zimmermann about 5 years ago
- Status changed from New to Needs Feedback
- Assignee set to Matthias Gwiozda
Updated by Matthias Gwiozda about 5 years ago
- File kontakt.form.yaml kontakt.form.yaml added
Ralf Zimmermann wrote:
`{element.required}` is a form element API (https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/form/Classes/Domain/Model/FormElements/AbstractFormElement.php#L129) which checks for the existance of the `NotEmptyValidator`.
Can you provide your full form definition? Did the `NotEmptyValidator` exists within your form element?
I appended the yaml - File in this answer
Updated by Ralf Zimmermann about 5 years ago
- Status changed from Needs Feedback to New
- Assignee deleted (
Matthias Gwiozda)
Updated by Ralf Zimmermann about 5 years ago
- File 9.5.12-dev.png 9.5.12-dev.png added
- File 10.2.0-dev.png 10.2.0-dev.png added
I can not reproduce the issue with fresh instances for TYPO3 10.2.0-dev and 9.5.12-dev
- 9.5.12-dev
- 10.2.0-dev
Updated by Ralf Zimmermann about 5 years ago
- Status changed from New to Needs Feedback
- Assignee set to Matthias Gwiozda
In which exact version of TYPO3 you can produce this issue?
Updated by Mathias Brodala about 5 years ago
Could it be that you have placed the same form more than once on the same page? There is a known issue (#88730) which prevents validators from being added to anything but the 1st instance of a form on a page.
Updated by Björn Jacob about 5 years ago
- Related to Bug #88730: Validators of a field with the same identifier is working only once on a page added
Updated by Matthias Gwiozda about 5 years ago
Mathias Brodala wrote:
Could it be that you have placed the same form more than once on the same page? There is a known issue (#88730) which prevents validators from being added to anything but the 1st instance of a form on a page.
The Form is only once at this page. Here it is: https://www.sws-energie.de/privatkunden/info-formulare/kontakt
Updated by Björn Jacob about 5 years ago
- Subject changed from Typo3 Forms Extension: Required - Indicators (*) are not shown to TYPO3 Forms Extension: Required - Indicators (*) are not shown
Please provide more information. Which templates did you override? Which parts did you customize?
Updated by Matthias Gwiozda about 5 years ago
Bjoern Jacob wrote:
Please provide more information. Which templates did you override? Which parts did you customize?
I didn't override the Templates. I just created a simple Form and added some required Fields.
Updated by Riccardo De Contardi almost 5 years ago
At a quick glance I am not able to reproduce this issue with TYPO3 9.5.11 - plain TYPO3 installation
Updated by Ralf Zimmermann almost 5 years ago
- Related to Bug #90083: Validators are empty if the same form is rendered multiple times on a page added
Updated by Matthias Gwiozda almost 5 years ago
Riccardo De Contardi wrote:
At a quick glance I am not able to reproduce this issue with TYPO3 9.5.11 - plain TYPO3 installation
It looks like there is something customized in our extension that causes the problem.
If this problem doesn't show up on a plain TYPO3 installation I have to search for the cause - but at the moment it doesn't look like that I got time for this (sorry).
Lets close this issue for now and pretend it's some magic that's just happening in our TYPO3 - Instance for whatever reason.
Updated by Björn Jacob almost 5 years ago
@Matthias we are having the same problem in one of our instances. See the connected issue. Maybe you can apply the patch and see if your problem is solved. Ralf wrote a huge explanation.
Updated by Riccardo De Contardi almost 5 years ago
Hi Can you test if it has been solved with #90083 ?
Updated by Björn Jacob over 4 years ago
- Status changed from Needs Feedback to Closed
- Assignee deleted (
Matthias Gwiozda) - Sprint Focus set to Remote Sprint
Since the author opted for closing this issue, I am closing it now :) IMHO the issue has been fixed with the mentioned patch in #90083.