[BUGFIX] Properly reset form renderable validators
Since form renderable validators are stored as SplObjectStorage instances, it is currently impossible to properly reset those validators, e.g. within a configured variant in the form configuration. This is because detaching during a foreach over SplObjectStorage instances updates the internal pointer. This leads to inconsistent behavior in the foreach loop. To come around this issue, a cloned SplObjectStorage is now used to remove all currently registered validators, properly resetting all validators for the form renderable. Additionally, this edge case is now covered by a functional test case. Resolves: #96424 Releases: main, 11.5 Change-Id: I91268e28a2c08fa21d655373e272204fbb9b84f4 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/73657 Tested-by:core-ci <typo3@b13.com> Tested-by:
Helmut Hummel <typo3@helhum.io> Tested-by:
waldhacker <hello@waldhacker.dev> Reviewed-by:
Helmut Hummel <typo3@helhum.io> Reviewed-by:
waldhacker <hello@waldhacker.dev>
Showing
- typo3/sysext/form/Classes/Domain/Model/Renderable/AbstractRenderable.php 1 addition, 1 deletion...rm/Classes/Domain/Model/Renderable/AbstractRenderable.php
- typo3/sysext/form/Classes/Mvc/Property/PropertyMappingConfiguration.php 1 addition, 1 deletion...orm/Classes/Mvc/Property/PropertyMappingConfiguration.php
- typo3/sysext/form/Tests/Functional/Domain/Model/Renderable/AbstractRenderableTest.php 74 additions, 0 deletions...tional/Domain/Model/Renderable/AbstractRenderableTest.php
Please register or sign in to comment