bobosch/ods_osm

Replace $GLOBALS['TSFE']->sys_language_content with language aspect

Closed this issue · 0 comments

Occurences

if ($GLOBALS['TSFE']->sys_language_content && $ctrl['transOrigPointerField']) {

if ($GLOBALS['TSFE']->sys_language_content && $ctrl['transOrigPointerField']) {

$queryBuilder->createNamedParameter((int) ($GLOBALS['TSFE']->sys_language_content), \PDO::PARAM_INT)),

$queryBuilder->createNamedParameter((int) ($GLOBALS['TSFE']->sys_language_content), \PDO::PARAM_INT)),

Solution

$GLOBALS['TSFE']->sys_language_content is deprecated in 9

https://docs.typo3.org/c/typo3/cms-core/master/en-us/Changelog/9.4/Deprecation-85543-Language-relatedPropertiesInTypoScriptFrontendControllerAndPageRepository.html

and removed in 10

https://docs.typo3.org/c/typo3/cms-core/master/en-us/Changelog/10.0/Breaking-87193-DeprecatedFunctionalityRemoved.html?highlight=sys_language_content

Can be replaced by language aspect:

$languageAspect = GeneralUtility::makeInstance(Context::class)->getAspect('language');
// (previously known as TSFE->sys_language_content)
$languageAspect->getContentId();