Project

General

Profile

Actions

Bug #104998

closed

Type error on using addCacheTags from TypoScriptFrontendController

Added by Karsten Nowak (undkonsorten) about 1 month ago. Updated 13 days ago.

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.


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Feature #104990: Automatic frontend cache taggingClosed2024-09-16

Actions
Actions

Also available in: Atom PDF