Review main Merged

91926[BUGFIX] Account for symfony/dependency-injection:7.4 incompatibility

Benjamin Franzke CR +2 V +2 Normal +51 −0 updated 12/01/25, 10:34

Commit message

Symfony DI added [1] a non-optional `class_exists()` check in
`Symfony\Component\DependencyInjection\Compiler\ResolveClassPass`
for the versions >=7.4 (including 8.0), which is no longer guarded
by a previous `$definition instanceof ChildDefinition` condition.

This causes PHP errors when classes are (tried to be) autoloaded, that
implement interfaces which are not available (because they use them as
an optional dependency, like optional EXT:reports integration).

The change was initially implemented as a breaking change, but was
intended to be lifted to be only a deprecation later [2].

This relaxation works for classes that are not available at all, but not
for classes that are available from a autoloader perspective, but
whose static dependencies are not and are therefore not loadable.

As a solution we revert to the old class resolution algorithm from
v7.3 and enqueue this overwrite for the upstream class resolution
compiler pass, which makes the upstream compiler pass a no-op.

An upstream fix is hopefully added later on via:
https://github.com/symfony/symfony/pull/62544

[1] https://github.com/symfony/symfony/pull/61215
[2] https://github.com/symfony/symfony/pull/62544

Review

  • Code review CR +2 Done
    • Benjamin Franzke +2
    • Markus Klein +1
    • Stefan Bürk +1
  • Verified V +2 Done
    • Benjamin Franzke +2
    • Stephan Großberndt +1
    • Markus Klein +1
    • Stefan Bürk +1
    • Achim Fritz +1
    • core-ci +1 CI

Issues 1

Files 2

Review log 2026

Show 1 earlier messages
  1. Benjamin Franzke uploaded patch set 1 11/28/25, 08:05

  1. Benjamin Franzke uploaded patch set 2 11/28/25, 08:08

  2. core-ci voted on patch set 1 V -1 11/28/25, 08:14 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/91183

  3. core-ci voted on patch set 2 V +1 11/28/25, 08:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/91184

  4. Oli Bartsch commented on patch set 2 11/28/25, 08:39

    ResolveClassPass.php:33

    Could we please add a short explanation for this hard to read regex or at least reference where it comes from?
  5. Benjamin Franzke uploaded patch set 3 V +1 11/28/25, 08:41

  6. Benjamin Franzke commented on patch set 3 11/28/25, 08:43

    ResolveClassPass.php:33 Reply

    See https://review.typo3.org/c/Packages/TYPO3.CMS/+/91926/3//COMMIT_MSG#25, this is a copy of upstream code. I will for sure add a reference to the class header that this is a copy of the 7.3 upstream class.
  7. Benjamin Franzke uploaded patch set 4 11/28/25, 08:47

  8. core-ci voted on patch set 3 V +1 11/28/25, 08:50 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/91188

  9. core-ci voted on patch set 4 V -1 11/28/25, 08:57 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/91189

  10. core-ci voted on patch set 4 V +1 11/28/25, 09:16 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/91189

  11. Benjamin Franzke commented on patch set 4 11/28/25, 09:17

    ResolveClassPass.php:33 Reply

    Done
  12. Garvin Hicking commented on patch set 4 11/28/25, 09:18

    ```suggestion Symfony added a non-optional `class_exists` check in `ResolveClassPass` ```
    ```suggestion for the DI versions >=7.4 (including 8.0), which is no longer is guarded ```
  13. Garvin Hicking commented on patch set 4 11/28/25, 09:19

    thanks!

    ResolveClassPass.php:27

    ```suggestion * class resolution that introduced an incompatibility with existing ```
  14. Stefan Bürk commented on patch set 4 V +1 11/28/25, 09:22

    Works for me in TYPO3 main(14), 13.4 and 12.4
  15. Benjamin Franzke uploaded patch set 5 V +1 11/28/25, 09:56

  16. Benjamin Franzke commented on patch set 5 11/28/25, 09:56

    Reply

    Done

    Reply

    Done

    ResolveClassPass.php:27 Reply

    Done
  17. core-ci voted on patch set 5 V +1 11/28/25, 10:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/91192

  18. Achim Fritz commented on patch set 5 V +1 11/28/25, 12:36

    works for me on dev-main
  19. Stefan Bürk voted on patch set 5 CR +1 V +1 11/28/25, 13:18

  20. Markus Klein commented on patch set 5 V -1 11/28/25, 14:40

    tested this patch on a v12 instance, but still fails. checking why
  21. Markus Klein commented on patch set 5 CR +1 V +1 11/28/25, 14:44

    Reply

    It was a patch-issue on my side. works. thanks.
  22. Stephan Großberndt commented on patch set 5 V +1 12/01/25, 09:39

    Works on 12.4.39
  23. Stephan Großberndt commented on patch set 5 12/01/25, 09:39

    Reply

    Done
  24. Benjamin Franzke voted on patch set 5 CR +2 V +2 12/01/25, 10:33

  25. Benjamin Franzke merged patch set 6 12/01/25, 10:34