Skip to content
  • Helmut Hummel's avatar
    [BUGFIX] Consistently fetch SiteConfiguration from DI · cd8a613c
    Helmut Hummel authored
    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>
    cd8a613c