Actions
Bug #104998
closedType error on using addCacheTags from TypoScriptFrontendController
Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2024-09-17
Due date:
% Done:
100%
Estimated time:
TYPO3 Version:
13
PHP Version:
8.2
Tags:
Complexity:
Is Regression:
Sprint Focus:
Description
Error occurs when addCacheTags function in TypoScriptFrontendController is used by extensions.
I had this with installed news in my TYPO3 13 (main branch) instance.
TYPO3\CMS\Core\Cache\CacheDataCollector::addCacheTags(): Argument #1 must be of type TYPO3\CMS\Core\Cache\CacheTag, array given, called in /app/vendor/typo3/cms-frontend/Classes/Controller/TypoScriptFrontendController.php on line 424
The relevant code is this line (424) in TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController
$cacheDataCollector->addCacheTags(array_map(fn(string $tag) => new CacheTag($tag), $tags));
That should be changed to
$cacheDataCollector->addCacheTags(...array_map(fn(string $tag) => new CacheTag($tag), $tags));
I will add a patch for that afterwards.
Actions