Review 14.3 Merged

94907[BUGFIX] Keep all PSR-4 paths of shared prefixes

Stefan Bürk CR +2 V +2 Normal +183 −9 updated 07/23/26, 13:41

Commit message

Class loading information is dumped and registered for the active
extensions of an instance whenever TYPO3 does not run in Composer mode.
Functional test instances are classic mode instances by definition, so
this happens on top of a fully populated Composer class loader as well.

Registering that information is destructive: ClassLoader::setPsr4()
replaces all directories of a namespace prefix instead of adding to
them. A prefix can be used by more than one package, for instance when
an extension ships a framework agnostic library of the same namespace
as a dedicated Composer package. The directories of that library are
dropped the moment the class loading information is registered, and
every class below them fails with "Class not found".

The generator has the same flaw one level below: it accumulates the per
package information with array_merge(), which overwrites string keys,
so two active extensions using the same PSR-4 prefix clobber each other
already while the dump is written.

Both places now accumulate per prefix. The directories of the extensions
keep precedence, all others are kept as fallback. Registration is
de-duplicated to stay idempotent, since functional tests bootstrap TYPO3
more than once per process.

Reported downstream as
https://github.com/TYPO3/testing-framework/issues/667

Review

  • Code review CR +2 Done
    • Stefan Bürk +2
  • Verified V +2 Done
    • Stefan Bürk +2
    • core-ci +1 CI

Issues 1

Files 5

Review log 34

  1. Stefan Bürk commented on patch set 1 07/23/26, 13:10

    Cherry Picked from branch main.
  2. core-ci voted on patch set 1 V +1 07/23/26, 13:18 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/105252

  3. Stefan Bürk voted on patch set 1 CR +2 V +2 07/23/26, 13:41

  4. Stefan Bürk merged patch set 2 07/23/26, 13:41