Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
simonschaufi opened this issue Oct 15, 2024 · 0 comments

Comments

@simonschaufi
Copy link
Collaborator

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

https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/13.3/Deprecation-102422-TypoScriptFrontendController-addCacheTags.html

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

See 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)
);
// Before
$GLOBALS['TSFE']->getPageCacheTags();

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

PHP-API, FullyScanned, ext:core

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant