Bug #89236

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

Added by Matthias Gwiozda about 1 year ago. Updated 8 months ago.

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

0%

Estimated time:
TYPO3 Version:
10
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:
Remote Sprint

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

required_forms.png (36.6 KB) required_forms.png Matthias Gwiozda, 2019-09-24 08:13
kontakt.form.yaml (3.58 KB) kontakt.form.yaml Matthias Gwiozda, 2019-11-22 09:22
9.5.12-dev.png (16.8 KB) 9.5.12-dev.png Ralf Zimmermann, 2019-11-22 16:40
10.2.0-dev.png (18.7 KB) 10.2.0-dev.png 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 pageClosedMathias Brodala2019-07-11

Actions
Related to TYPO3 Core - Bug #90083: Validators are empty if the same form is rendered multiple times on a pageClosed2020-01-10

Actions
#1

Updated by Michael Stucki about 1 year ago

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

Updated by Georg Ringer about 1 year ago

  • Category set to Form Framework
#3

Updated by Susanne Moog about 1 year ago

  • Sprint Focus set to Remote Sprint
#4

Updated by Ralf Zimmermann about 1 year 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 about 1 year ago

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

Updated by Matthias Gwiozda about 1 year 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 about 1 year ago

  • File kontakt.form.yaml added
#8

Updated by Matthias Gwiozda about 1 year ago

  • File deleted (kontakt.form.yaml)
#9

Updated by Ralf Zimmermann about 1 year ago

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

Updated by Ralf Zimmermann about 1 year 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 about 1 year 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 about 1 year 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 about 1 year ago

  • Sprint Focus deleted (Remote Sprint)
#14

Updated by Bjoern Jacob about 1 year 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 about 1 year 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 about 1 year 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 about 1 year 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.

#18

Updated by Riccardo De Contardi 12 months ago

At a quick glance I am not able to reproduce this issue with TYPO3 9.5.11 - plain TYPO3 installation

#19

Updated by Ralf Zimmermann 11 months ago

  • Related to Bug #90083: Validators are empty if the same form is rendered multiple times on a page added
#20

Updated by Matthias Gwiozda 11 months 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.

#21

Updated by Bjoern Jacob 11 months 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.

#22

Updated by Riccardo De Contardi 10 months ago

Hi Can you test if it has been solved with #90083 ?

#23

Updated by Bjoern Jacob 8 months 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.

Also available in: Atom PDF