Skip to content
Snippets Groups Projects
Commit cd8a613c authored by Helmut Hummel's avatar Helmut Hummel
Browse files

[BUGFIX] Consistently fetch SiteConfiguration from DI

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.

Resolves: #91260
Releases: master
Change-Id: I8af1cafd737feccff9e06eacb23d6991105238d0
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/64386


Tested-by: default avatarBenjamin Franzke <bfr@qbus.de>
Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: default avatarHelmut Hummel <typo3@helhum.io>
Reviewed-by: default avatarBenjamin Franzke <bfr@qbus.de>
Reviewed-by: default avatarDaniel Goerz <daniel.goerz@posteo.de>
Reviewed-by: default avatarHelmut Hummel <typo3@helhum.io>
parent f1a8ae98
No related merge requests found
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment