Review main Merged

64386[BUGFIX] Consistently fetch SiteConfiguration from DI

Helmut Hummel CR +2 V +2 Easy +19 −26 updated 05/11/20, 18:37

Commit message

SiteConfiguration is available from the DI container (both in failsafe and
symfony DI), therefore no constructor arguments MUST be passed to
GeneralUtility::makeInstance when fetching the SiteConfiguration singleton
instance, or a new instance will be created.

There are however multiple places where this object is still created
by passing constructor arguments to GeneralUtility::makeInstance
(this bypasses proxying to the container).
This leads to the situation that two different objects are created and
retrieved, depending on how it is fetched.

This is now fixed by changing each remaining retrieval via makeInstance
to NOT provide constructor arguments, which in turn results in a call to
the container to fetch the SiteConfiguration object.

Additionally the ServiceProvider introduced in #89892 is changed to allow
providing an alternative implementation using XCLASS. Although XCLASSES
are generally discouraged in favor of Services.yaml overwrites, there is
no other way to provide an alternative for this class, as it is registered
in an internal service provider.

Review

  • Code review CR +2

    Imported before Forger kept the single votes, the next import adds them.

  • Verified V +2

    Imported before Forger kept the single votes, the next import adds them.

Issues 1

Files 9