Project

General

Profile

Actions

Bug #89236

closed

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

Added by Matthias Gwiozda over 4 years ago. Updated about 4 years 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 2 (0 open2 closed)

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
Actions #1

Updated by Michael Stucki over 4 years ago

  • Project changed from 9 to TYPO3 Core
  • Category deleted (Development)
  • TYPO3 Version set to 10
Actions #2

Updated by Georg Ringer over 4 years ago

  • Category set to Form Framework
Actions #3

Updated by Susanne Moog over 4 years ago

  • Sprint Focus set to Remote Sprint
Actions #4

Updated by Ralf Zimmermann over 4 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?

Actions #5

Updated by Ralf Zimmermann over 4 years ago

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

Updated by Matthias Gwiozda over 4 years 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

Actions #7

Updated by Matthias Gwiozda over 4 years ago

  • File kontakt.form.yaml added
Actions #8

Updated by Matthias Gwiozda over 4 years ago

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

Updated by Ralf Zimmermann over 4 years ago

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

Updated by Ralf Zimmermann over 4 years 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

Actions #11

Updated by Ralf Zimmermann over 4 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?

Actions #12

Updated by Mathias Brodala over 4 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.

Actions #13

Updated by Björn Jacob over 4 years ago

  • Sprint Focus deleted (Remote Sprint)
Actions #14

Updated by Björn Jacob over 4 years ago

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

Updated by Matthias Gwiozda over 4 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

Actions #16

Updated by Björn Jacob over 4 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?

Actions #17

Updated by Matthias Gwiozda over 4 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.

Actions #18

Updated by Riccardo De Contardi over 4 years ago

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

Actions #19

Updated by Ralf Zimmermann over 4 years ago

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

Updated by Matthias Gwiozda over 4 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.

Actions #21

Updated by Björn Jacob over 4 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.

Actions #22

Updated by Riccardo De Contardi about 4 years ago

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

Actions #23

Updated by Björn Jacob about 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.

Actions

Also available in: Atom PDF