Skip to content
Snippets Groups Projects
  • Christian Kuhn's avatar
    [BUGFIX] Avoid static state in LocalizationUtility · 727fb0e5
    Christian Kuhn authored
    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: default avatarChristian Kuhn <lolli@schwarzbu.ch>
    Tested-by: default avatarcore-ci <typo3@b13.com>
    Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
    727fb0e5