#106060Missing Lifetime in cachetag generation
Description
The ContentObjectRenderer creates in the render function cacheTags, but don’t set the lifetime which can leads to an error
gmdate(): Argument #2 ($timestamp) must be of type ?int, float given because it’s use the PHP_MAX_INT value.
At the moment this onyl happens if I use the yoast preview in the backend context.
I have a TypoScript snippet which creates an cache entry:
cache {
lifetime = unlimited
tags = tag_typoscript
}
Here is the part of the ContentObjectRenderer where the cacheTag does not get the lifetime:
// Store cache
if ($cacheConfiguration !== null && $this->getRequest()->getAttribute('frontend.cache.instruction')->isCachingAllowed()) {
$key = $this->calculateCacheKey($cacheConfiguration);
if (!empty($key)) {
$cacheFrontend = GeneralUtility::makeInstance(CacheManager::class)->getCache('hash');
$tags = $this->calculateCacheTags($cacheConfiguration);
$lifetime = $this->calculateCacheLifetime($cacheConfiguration);
$cachedData = [
'content' => $content,
'cacheTags' => $tags,
];
$cacheFrontend->set($key, $cachedData, $tags, $lifetime);
$this->getRequest()->getAttribute('frontend.cache.collector')->addCacheTags(
...array_map(fn(string $tag) => new CacheTag($tag), $tags)
);
}
}Reviews 2
History 36
-
Pascal Geldmacher commented 02/03/25, 12:09
-
Gerrit Code Review pushed patch set 1 for main to change 88100 status
NewUnder Review 02/08/25, 11:55 -
Gerrit Code Review pushed patch set 2 for main to change 88100 02/08/25, 20:41
-
Gerrit Code Review pushed patch set 1 for 13.4 to change 88121 02/09/25, 18:30
-
Sascha Nowak commented and changed status
Under ReviewResolved done0 %100 % 02/09/25, 18:50Applied in changeset commit:ae09ed5db73ab7b209e4631062109acfb06dc031.
-
Benni Mack changed status
ResolvedClosed 12/02/25, 14:26
The problem only happens if the feature frontend.cache.autoTagging is disabled.