[BUGFIX] Avoid static state in LocalizationUtility
The extbase ConfigurationManager is (unfortunately) a stateful singleton that we can not get rid of without a bigger rewrite. While stateful singletons are bad enough, the extbase LocalizationUtility makes this worse by parking an instance of ConfigurationManager in a static property, re-using it as a "cached" singleton. LocalizationUtility does this since it in itself is static, which makes this service just so convenient to use. When it comes to sub requests and similar, static state is doomed and we need to get rid of it, we've had a couple of patches in v12 dealing with similar things. Mid-term, extbase LocalizationUtility needs to vanish anyways, but in the meantime, we have to get rid of static state that kills sub request scope. The patch removes the static $configurationManager property and adapts functional tests that already showed the current solution was a hack. There are various upper and lower cache layers that ensure removing this "cache layer" won't make things more expensive in practice, which allows us to remove this static state without further fallback. In main, this needs a TF update: > composer u typo3/testing-framework In 12.4, this need a TF raise: > composer req --dev typo3/testing-framework:^8.0.3 Resolves: #101779 Releases: main, 12.4 Change-Id: Ie5db07b0475f612a996d369ab3417672b33fbb2d Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/80737 Reviewed-by:Christian Kuhn <lolli@schwarzbu.ch> Tested-by:
core-ci <typo3@b13.com> Tested-by:
Christian Kuhn <lolli@schwarzbu.ch>
Showing
- composer.json 1 addition, 1 deletioncomposer.json
- composer.lock 7 additions, 7 deletionscomposer.lock
- typo3/sysext/extbase/Classes/Utility/LocalizationUtility.php 1 addition, 18 deletionstypo3/sysext/extbase/Classes/Utility/LocalizationUtility.php
- typo3/sysext/extbase/Tests/Functional/Utility/LocalizationUtilityTest.php 18 additions, 35 deletions...base/Tests/Functional/Utility/LocalizationUtilityTest.php
- typo3/sysext/extbase/Tests/FunctionalDeprecated/Utility/LocalizationUtilityTest.php 7 additions, 22 deletions.../FunctionalDeprecated/Utility/LocalizationUtilityTest.php
Please register or sign in to comment