Review main Ready for review

98214[FEATURE] Resolve Symfony constraint validators from the container

Alexander Schnitzler CR +1 V +1 Hard +549 −3 updated 11/30/26, 16:55

Commit message

The Symfony validator bridge built a fresh validator without a
container on every validate() call. Constraint validators of
extensions could therefore not have constructor dependencies, and
constraints that name their validator by service id, such as
Symfony's Expression constraint, could not be used.

The Symfony validator is now a private service created by the new
internal ValidatorFactory. It uses a ContainerConstraintValidatorFactory
backed by a service locator of all services tagged with
extbase.constraint_validator. Every ConstraintValidatorInterface
implementation is tagged through autoconfiguration. The service
validator.expression is registered for the Expression constraint.

ValidatorResolver and ConstraintDecoratingValidator receive the
validator through new optional constructor parameters. Existing call
sites keep working and fall back to the previous behavior. Validators
that are no services are still instantiated without arguments.
Show more Show less

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

Review

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

Merge conflicts 10

Show 5 more changes Show less

Issues 1

Files 13

Review log 68

  1. Alexander Schnitzler uploaded patch set 1 11/30/26, 13:04

  2. Alexander Schnitzler wrote 11/30/26, 13:05

    Topic set to extbase
  3. core-ci voted on patch set 1 V -1 11/30/26, 13:14 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/116019

  4. Alexander Schnitzler uploaded patch set 2 V -1 11/30/26, 13:15

  5. Alexander Schnitzler commented on patch set 2 11/30/26, 13:17

  6. core-ci voted on patch set 2 V +1 11/30/26, 13:22 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/116022

  7. Oliver Klee voted on patch set 2 CR +1 V +1 11/30/26, 14:35

  8. Simon Schaufelberger voted on patch set 2 CR +1 V +1 11/30/26, 16:55