Bug #88730

Validators of a field with the same identifier is working only once on a page

Added by Oliver Bartsch 6 months ago. Updated 26 days ago.

Status:
Closed
Priority:
Should have
Category:
Form Framework
Target version:
-
Start date:
2019-07-11
Due date:
% Done:

100%

TYPO3 Version:
9
PHP Version:
7.2
Tags:
form, validators, form fields
Complexity:
Is Regression:
Sprint Focus:
Remote Sprint

Description

If one has the same form twice on the same page, the second form is missing the configured validators. The SplObjectStorage is empty.
This also happens with different forms on the same page, if they have the same fields with the same `identifiers`.
I’m able to reproduce this on two different projects (TYPO3 version 9.5.8), but not for Version 8.

How to reproduce:
  1. Create a form and use some validators e.g. "NotEmpty" (With the GUI or directly with YAML configuration)
  2. Add the form to a site (Plugin: Form Framework)
  3. Add the same form to the same site
  4. Debug the validators or simply look for the asterisks on required (NonEmpty) fields in the frontend. They are missing on the second form.

I know having the same form twice on a site is not a real life use case, it's just to reproduce the behaviour quickly. The bug is that two identical fields (same identifer) in different forms on the same page are not working independently from each other like they did in v8.


Related issues

Related to TYPO3 Core - Bug #89040: Typo3 form validation Closed 2019-08-29
Related to TYPO3 Core - Bug #89236: TYPO3 Forms Extension: Required - Indicators (*) are not shown Needs Feedback 2019-09-24
Related to TYPO3 Core - Bug #90083: Validators are empty if the same form is rendered multiple times on a page Under Review 2020-01-10

Associated revisions

Revision c16f26cf (diff)
Added by Mathias Brodala about 2 months ago

[BUGFIX] Respect unique form identifier for validators

Make sure to apply all configured validators if a form is used multiple
times on the same page.

Resolves: #88730
Releases: master, 9.5
Change-Id: Id2fd63fd83cd2ff657f5bbc3b427147adfd8ab38
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/62381
Tested-by: TYPO3com <>
Tested-by: Ralf Zimmermann <>
Reviewed-by: Ralf Zimmermann <>

Revision 235ef322 (diff)
Added by Mathias Brodala about 2 months ago

[BUGFIX] Respect unique form identifier for validators

Make sure to apply all configured validators if a form is used multiple
times on the same page.

Resolves: #88730
Releases: master, 9.5
Change-Id: Id2fd63fd83cd2ff657f5bbc3b427147adfd8ab38
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/62398
Tested-by: TYPO3com <>
Tested-by: Björn Jacob <>
Tested-by: Ralf Zimmermann <>
Reviewed-by: Björn Jacob <>
Reviewed-by: Ralf Zimmermann <>

History

#1 Updated by Riccardo De Contardi 5 months ago

  • Related to Bug #89040: Typo3 form validation added

#2 Updated by Susanne Moog 2 months ago

  • Sprint Focus set to Remote Sprint

#3 Updated by Mathias Brodala about 2 months ago

  • Status changed from New to In Progress
  • Assignee set to Mathias Brodala

#4 Updated by Gerrit Code Review about 2 months ago

  • Status changed from In Progress 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/c/Packages/TYPO3.CMS/+/62381

#5 Updated by Gerrit Code Review about 2 months ago

Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/62398

#6 Updated by Mathias Brodala about 2 months ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#7 Updated by Bjoern Jacob about 2 months ago

  • Related to Bug #89236: TYPO3 Forms Extension: Required - Indicators (*) are not shown added

#8 Updated by Benni Mack 26 days ago

  • Status changed from Resolved to Closed

#9 Updated by Ralf Zimmermann 8 days ago

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

Also available in: Atom PDF