[BUGFIX] Respect unique form identifier for validators 81/62381/2
authorMathias Brodala <mbrodala@pagemachine.de>
Fri, 22 Nov 2019 15:57:17 +0000 (16:57 +0100)
committerRalf Zimmermann <ralf.zimmermann@tritum.de>
Sat, 23 Nov 2019 08:55:15 +0000 (09:55 +0100)
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 <noreply@typo3.com>
Tested-by: Ralf Zimmermann <ralf.zimmermann@tritum.de>
Reviewed-by: Ralf Zimmermann <ralf.zimmermann@tritum.de>
typo3/sysext/form/Classes/Domain/Model/Renderable/AbstractRenderable.php

index 8149be0..61d4dd5 100644 (file)
@@ -168,7 +168,11 @@ abstract class AbstractRenderable implements RenderableInterface, VariableRender
             }
 
             foreach ($options['validators'] as $validatorConfiguration) {
-                $configurationHash = md5($this->getIdentifier() . json_encode($validatorConfiguration));
+                $configurationHash = md5(
+                    $this->getRootForm()->getIdentifier() .
+                    $this->getIdentifier() .
+                    json_encode($validatorConfiguration)
+                );
                 if (in_array($configurationHash, $configurationHashes)) {
                     continue;
                 }