Bug #89236

TYPO3 Forms Extension: Required - Indicators (*) are not shown

Added by Matthias Gwiozda 2 months ago. Updated 11 days ago.

Status:
Needs Feedback
Priority:
Should have
Category:
Form Framework
Target version:
-
Start date:
2019-09-24
Due date:
% Done:

0%

TYPO3 Version:
10
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

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.

required_forms.png View (36.6 KB) Matthias Gwiozda, 2019-09-24 08:13

kontakt.form.yaml View (3.58 KB) Matthias Gwiozda, 2019-11-22 09:22

9.5.12-dev.png View (16.8 KB) Ralf Zimmermann, 2019-11-22 16:40

10.2.0-dev.png View (18.7 KB) Ralf Zimmermann, 2019-11-22 16:41


Related issues

Related to TYPO3 Core - Bug #88730: Validators of a field with the same identifier is working only once on a page Resolved 2019-07-11

History

#1 Updated by Michael Stucki 2 months ago

  • Project changed from forge.typo3.org to TYPO3 Core
  • Category deleted (Development)
  • TYPO3 Version set to 10

#2 Updated by Georg Ringer about 2 months ago

  • Category set to Form Framework

#3 Updated by Susanne Moog 19 days ago

  • Sprint Focus set to Remote Sprint

#4 Updated by Ralf Zimmermann 15 days 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?

#5 Updated by Ralf Zimmermann 15 days ago

  • Status changed from New to Needs Feedback
  • Assignee set to Matthias Gwiozda

#6 Updated by Matthias Gwiozda 14 days ago

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

#7 Updated by Matthias Gwiozda 14 days ago

  • File kontakt.form.yaml added

#8 Updated by Matthias Gwiozda 14 days ago

  • File deleted (kontakt.form.yaml)

#9 Updated by Ralf Zimmermann 14 days ago

  • Status changed from Needs Feedback to New
  • Assignee deleted (Matthias Gwiozda)

#10 Updated by Ralf Zimmermann 14 days ago

I can not reproduce the issue with fresh instances for TYPO3 10.2.0-dev and 9.5.12-dev

  1. 9.5.12-dev


  1. 10.2.0-dev

#11 Updated by Ralf Zimmermann 14 days ago

  • Status changed from New to Needs Feedback
  • Assignee set to Matthias Gwiozda

In which exact version of TYPO3 you can produce this issue?

#12 Updated by Mathias Brodala 14 days 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.

#13 Updated by Bjoern Jacob 12 days ago

  • Sprint Focus deleted (Remote Sprint)

#14 Updated by Bjoern Jacob 12 days ago

  • Related to Bug #88730: Validators of a field with the same identifier is working only once on a page added

#15 Updated by Matthias Gwiozda 11 days 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

#16 Updated by Bjoern Jacob 11 days 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?

#17 Updated by Matthias Gwiozda 11 days 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.

Also available in: Atom PDF