[BUGFIX] Respect content_from_pid in page cache 31/63531/2
authorBenni Mack <benni@typo3.org>
Mon, 2 Mar 2020 22:11:12 +0000 (23:11 +0100)
committerGeorg Ringer <georg.ringer@gmail.com>
Tue, 3 Mar 2020 15:05:40 +0000 (16:05 +0100)
When using "content_from_pid" and the content from a different
pid is changing, the cache of the frontend page should be affected as well.

Resolves: #82249
Releases: master, 9.5
Change-Id: If62c01e1844e1369fab49db483600c9a6d907099
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/63531
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Oliver Bartsch <bo@cedev.de>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Oliver Bartsch <bo@cedev.de>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php

index 7c40e41..7e90e21 100644 (file)
@@ -2593,6 +2593,10 @@ class TypoScriptFrontendController implements LoggerAwareInterface
         ];
         $this->cacheExpires = $expirationTstamp;
         $this->pageCacheTags[] = 'pageId_' . $cacheData['page_id'];
+        // Respect the page cache when content of pid is shown
+        if ($this->id !== $this->contentPid) {
+            $this->pageCacheTags[] = 'pageId_' . $this->contentPid;
+        }
         if (!empty($this->page['cache_tags'])) {
             $tags = GeneralUtility::trimExplode(',', $this->page['cache_tags'], true);
             $this->pageCacheTags = array_merge($this->pageCacheTags, $tags);