[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:Benjamin Franzke <bfr@qbus.de> Tested-by:
TYPO3com <noreply@typo3.com> Tested-by:
Helmut Hummel <typo3@helhum.io> Reviewed-by:
Benjamin Franzke <bfr@qbus.de> Reviewed-by:
Daniel Goerz <daniel.goerz@posteo.de> Reviewed-by:
Helmut Hummel <typo3@helhum.io>
Showing
- typo3/sysext/backend/Classes/Controller/SiteConfigurationController.php 2 additions, 3 deletions...ackend/Classes/Controller/SiteConfigurationController.php
- typo3/sysext/backend/Classes/Form/FormDataProvider/SiteDatabaseEditRow.php 2 additions, 9 deletions...end/Classes/Form/FormDataProvider/SiteDatabaseEditRow.php
- typo3/sysext/backend/Configuration/Services.yaml 2 additions, 0 deletionstypo3/sysext/backend/Configuration/Services.yaml
- typo3/sysext/core/Classes/Hooks/CreateSiteConfiguration.php 1 addition, 4 deletionstypo3/sysext/core/Classes/Hooks/CreateSiteConfiguration.php
- typo3/sysext/core/Classes/ServiceProvider.php 1 addition, 1 deletiontypo3/sysext/core/Classes/ServiceProvider.php
- typo3/sysext/core/Classes/Site/SiteFinder.php 1 addition, 5 deletionstypo3/sysext/core/Classes/Site/SiteFinder.php
- typo3/sysext/extensionmanager/Classes/Utility/InstallUtility.php 1 addition, 4 deletions...ysext/extensionmanager/Classes/Utility/InstallUtility.php
- typo3/sysext/extensionmanager/Tests/Unit/Utility/InstallUtilityTest.php 5 additions, 0 deletions...xtensionmanager/Tests/Unit/Utility/InstallUtilityTest.php
- typo3/sysext/frontend/Tests/Unit/ContentObject/ContentObjectRendererTest.php 4 additions, 0 deletions...nd/Tests/Unit/ContentObject/ContentObjectRendererTest.php
Please register or sign in to comment