Deprecation: #85543 - Language-related properties in TypoScriptFrontendController and PageRepository
See forge#85543
Description
With the introduction of a LanguageAspect within the new Context API, the following public properties have been marked as deprecated:
TYPO3\
CMS\ Frontend\ Controller\ Typo Script Frontend Controller->sys_ language_ uid TYPO3\
CMS\ Frontend\ Controller\ Typo Script Frontend Controller->sys_ language_ content TYPO3\
CMS\ Frontend\ Controller\ Typo Script Frontend Controller->sys_ language_ content OL TYPO3\
CMS\ Frontend\ Controller\ Typo Script Frontend Controller->sys_ language_ mode TYPO3\
CMS\ Frontend\ Page\ Page Repository->sys_ language_ uid
Additionally, in order to create a better abstraction, the third constructor argument of
\TYPO3\
now expects a Context
object instead of a Page
.
Impact
Accessing or setting one of the properties will trigger a PHP E_
error.
Calling RootlineUtility constructor with a PageRepository as a third argument will trigger a PHP E_
error.
Affected Installations
Any multi-lingual TYPO3 installation with custom non-Extbase-related PHP code.
Migration
Use the new Language
with various superior properties to access the various values.
$languageAspect = GeneralUtility::makeInstance(Context::class)->getAspect('language');
// (previously known as TSFE->sys_language_uid)
$languageAspect->getId();
// (previously known as TSFE->sys_language_content)
$languageAspect->getContentId();
// (previously known as TSFE->sys_language_contentOL)
$languageAspect->getLegacyOverlayType();
// (previously known as TSFE->sys_language_mode)
$languageAspect->getLegacyLanguageMode();
Also, have a detailed look on what other properties the language aspect offers for creating fallback chains, and more sophisticated overlays.