Review 12.4 Merged

91943[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
    • Moritz Ngo +1
  • Verified V +2 Done
    • Benjamin Franzke +2
    • Moritz Ngo +1
    • core-ci +1 CI

Issues 1

Files 2

Review log 56

  1. Benjamin Franzke commented on patch set 1 12/01/25, 09:58

    Cherry Picked from branch 13.4.
  2. core-ci voted on patch set 1 V +1 12/01/25, 10:06 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/91334

  3. Benjamin Franzke commented on patch set 1 CR +1 V +1 12/01/25, 10:24

    Reproduced error and tested fix on v12 which is affected if symfony/dependency-injection 7.4 is used (e.g. when using PHP 8.4). Also tested the overwrite to be compatible with symfony/dependency-injection v6.4 (which is used when PHP 8.1 is in use). (Do not expected differently, since upstream `ResolveClassPass` use the same code in v6.4 and v7.3, only v7.4 changed).
  4. Moritz Ngo commented on patch set 1 CR +1 V +1 12/01/25, 10:30

    works for me :)
  5. Benjamin Franzke voted on patch set 1 CR +2 V +2 12/01/25, 10:34

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