95891[BUGFIX] Keep validation errors of an outer validate() call
Commit message
Test this change
Run a command in your clone of the TYPO3 Core. Then try what the change does and vote on Verified in Gerrit. How to review a patch
- Check out patch set 2
-
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/91/95891/2 && git checkout FETCH_HEAD - Cherry-pick onto main
-
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/91/95891/2 && git cherry-pick FETCH_HEAD
Review
-
Code review CR 0 Needs a vote
-
Verified V 0 Needs a vote
- core-ci +1 CI
Merge conflicts 3
Issues 1
Files 8
- typo3/sysext/core/Documentation/Changelog/14.3.x/Important-91029-RecursiveValidationKeepsErrors.rstnew+38 −0
- typo3/sysext/extbase/Classes/Validation/Validator/AbstractGenericObjectValidator.php+13 −9
- typo3/sysext/extbase/Classes/Validation/Validator/AbstractValidator.php2+39 −4
- typo3/sysext/extbase/Classes/Validation/Validator/CollectionValidator.php+21 −18
- typo3/sysext/extbase/Tests/Functional/Validation/RecursiveValidationTest.phpnew+64 −0
- typo3/sysext/extbase/Tests/Unit/Validation/Validator/Fixture/CallbackValidator.phpnew+36 −0
- typo3/sysext/extbase/Tests/Unit/Validation/Validator/AbstractValidatorTest.php+31 −0
- typo3/sysext/extbase/Tests/Unit/Validation/Validator/GenericObjectValidatorTest.php+33 −0
Review log 1214
-
Georg Ringer uploaded patch set 1 09/16/26, 20:20
-
Georg Ringer commented on patch set 1 09/16/26, 20:26
This change is ready for review. -
core-ci voted on patch set 1 V +1 09/16/26, 20:29 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/108719
-
Simon Schaufelberger commented on patch set 1 09/17/26, 09:02
should we also backport that to v13? -
Georg Ringer commented on patch set 1 10/02/26, 16:22
IMO no need for 13.x -
Simon Schaufelberger commented on patch set 1 10/02/26, 17:36
Reply
I mean the bug exists since TYPO3 9, so yeah... -
Georg Ringer commented on patch set 1 10/02/26, 17:43
Reply
Yes and we even define versions as eol even though those are still used. The core team is responsible for the core and in the end most of us do it in their spare time and even if not, we need to always take extra care if a change is breaking for others. Every Bugfix can be potentially be breaking for people depending on that behavior and the mails, shitstorm is always on us. The bug is there since 9x and nobody cared or maybe just handled it on their own. -
Simon Schaufelberger voted on patch set 1 CR +1 V +1 10/02/26, 20:10
-
Simon Schaufelberger commented on patch set 1 10/02/26, 20:11
Reply
Done -
Alexander Schnitzler commented on patch set 1 V +1 10/17/26, 06:38
I would suggest to wrap the inner validation logic into try..finally blocks and to always return the result in the finally block to respect the invariant. A validator that throws can bring down the whole validation stack. It's the right direction but I think this could be a little bit more strict/safe. -
Oli Bartsch commented on patch set 1 V -1 10/20/26, 10:16
AbstractValidator.php:102This doesn't tell whether an outer call is still running, because $this->result stays set after every finished call. From the second top-level validate() on, the previous result gets pushed and restored. Between calls the instance then holds the result of its first call, not its latest. This shows wherever $this->result is read outside a running call. The other is custom validators that return $this->result after parent::validate(). Tracking the nesting depth explicitly would fix that, and it would fit together with Alexander's try/finally suggestion. -
Georg Ringer uploaded patch set 2
CR +1V +111/03/26, 19:50 -
Georg Ringer commented on patch set 2 11/03/26, 19:50
Reply
DoneAbstractValidator.php:102ReplyDone -
core-ci voted on patch set 2 V +1 11/03/26, 19:58 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/113214