Deprecation: #102422 - TypoScriptFrontendController->addCacheTags() and ->getPageCacheTags()

See forge#102422

Description

The methods \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController->addCacheTags() and \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController->getPageCacheTags() have been marked as deprecated.

Impact

Calling the methods \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController->addCacheTags() and \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController->getPageCacheTags() will trigger a PHP deprecation warning.

Affected installations

TYPO3 installations calling \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController->addCacheTags() or \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController->getPageCacheTags().

Migration

// Before
$GLOBALS['TSFE']->addCacheTags([
    'tx_myextension_mytable_123',
    'tx_myextension_mytable_456'
]);

// After
use TYPO3\CMS\Core\Cache\CacheTag;

$request->getAttribute('frontend.cache.collector')->addCacheTags(
    new CacheTag('tx_myextension_mytable_123', 3600),
    new CacheTag('tx_myextension_mytable_456', 3600)
);
Copied!
// Before
$GLOBALS['TSFE']->getPageCacheTags();

// After
$request->getAttribute('frontend.cache.collector')->getCacheTags();
Copied!