Merge conflict Gerrit cannot merge this change. It needs a rebase onto main.

Review main Ready for review

96335[BUGFIX] Skip validating collections without element validators

Benni Mack CR +1 V +1 Normal +223 −19 updated 11/10/26, 09:22

Commit message

The base validator of a domain model added a CollectionValidator for
every collection property, regardless of whether the element type
declares any validation rule. Such a model therefore always received
a non-empty base validator, which made every parent validate it, too.

When passing a domain object to an Extbase action, this caused lazy
relations to be loaded and whole collections to be iterated, only to
validate elements without any rule.

A collection validator is now only added if the element class, or any
class related to it, declares validation rules. The check walks the
class schemas instead of the base validators, as these are incomplete
while a cyclic relation is being built.

Additionally, the CollectionValidator resolves its element validator
once per collection instead of once per element, and stops early if
the element type has nothing to validate.

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 1
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/35/96335/1 && git checkout FETCH_HEAD
Cherry-pick onto main
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/35/96335/1 && git cherry-pick FETCH_HEAD

Review

  • Code review CR +1 Needs a vote
    • Simon Schaufelberger +1
  • Verified V +1 Needs a vote
    • Simon Schaufelberger +1
    • core-ci +1 CI

Issues 1

Files 6

Review log 34

  1. Benni Mack uploaded patch set 1 10/02/26, 20:25

  2. core-ci voted on patch set 1 V +1 10/02/26, 20:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/109999

  3. Benni Mack marked it ready for review 10/07/26, 15:16

  4. Simon Schaufelberger commented on patch set 1 CR +1 V +1 10/08/26, 00:24

    I guess this is a huge performance improvement when you have plenty of models that depend on each other