Project

General

Profile

Actions

Bug #104998

closed

Type error on using addCacheTags from TypoScriptFrontendController

Added by Karsten Nowak (undkonsorten) 2 months ago. Updated about 1 month 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 #1

Updated by Gerrit Code Review 2 months ago

  • Status changed from New to Under Review

Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/86133

Actions #2

Updated by Christian Kuhn 2 months ago

Actions #3

Updated by Gerrit Code Review 2 months ago

Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/86133

Actions #4

Updated by Karsten Nowak (undkonsorten) 2 months ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #5

Updated by Benni Mack about 1 month ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF