Commit 8b0e90c9 authored by Richard Haeser's avatar Richard Haeser
Browse files

[BUGFIX] Respect date aspect in PageRepository runtime cache

Pages with a date visibility outside the current date had their preview
link generated incorrectly as the runtime cache was already filled with
the data of the current date.

If the date aspect is taken into account proper preview links can be generated
for future or past pages as well.

Resolves: #92944
Releases: master, 10.4, 9.5
Change-Id: Icd5c1f8e1f0ddea07780d1ca1d1d050660443927
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/67479

Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: Richard Haeser's avatarRichard Haeser <richard@richardhaeser.com>
Reviewed-by: Richard Haeser's avatarRichard Haeser <richard@richardhaeser.com>
parent aa948d65
......@@ -242,8 +242,11 @@ class PageRepository implements LoggerAwareInterface
$userAspect = $this->context->getAspect('frontend.user');
$frontendUserIdentifier = 'user_' . (int)$userAspect->get('id') . '_groups_' . md5(implode(',', $userAspect->getGroupIds()));
// We need to respect the date aspect as we might have subrequests with a different time (e.g. backend preview links)
$dateTimeIdentifier = $this->context->getAspect('date')->get('timestamp');
$cache = $this->getRuntimeCache();
$cacheIdentifier = 'PageRepository_hidDelWhere' . ($show_hidden ? 'ShowHidden' : '') . '_' . (int)$this->versioningWorkspaceId . '_' . $frontendUserIdentifier;
$cacheIdentifier = 'PageRepository_hidDelWhere' . ($show_hidden ? 'ShowHidden' : '') . '_' . (int)$this->versioningWorkspaceId . '_' . $frontendUserIdentifier . '_' . $dateTimeIdentifier;
$cacheEntry = $cache->get($cacheIdentifier);
if ($cacheEntry) {
$this->where_hid_del = $cacheEntry;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment