Deprecation: #99020 - Deprecate TypoScript/TemplateService

See forge#99020

Description

The class TYPO3\CMS\Core\TypoScript\TemplateService has been marked as deprecated in TYPO3 v12 and will be removed in v13. This class is sometimes indirectly accessed using TypoScriptFrontendController->tmpl or $GLOBALS['TSFE']->tmpl.

Impact

The class TemplateService is part of the old TypoScript parser and has been substituted with a new parser approach. Actively calling class methods will trigger a deprecation log level warning.

Affected installations

Instances with extensions directly using TemplateService or indirectly using it by calling TypoScriptFrontendController->tmpl or $GLOBALS['TSFE']->tmpl are affected.

Migration

The class TemplateService is typically called in TYPO3 frontend scope. Extensions should avoid using TypoScriptFrontendController->tmpl and $GLOBALS['TSFE']->tmpl methods and properties. They can retrieve TypoScript from the PSR-7 request instead using the attribute frontend.typoscript. As example, the full frontend TypoScript can be retrieved like this:

$fullTypoScript = $request()->getAttribute('frontend.typoscript')->getSetupArray();