[BUGFIX] Respect no_cache in PageLinkBuilder 15/59715/2
authorGeorg Ringer <georg.ringer@gmail.com>
Mon, 18 Feb 2019 07:18:32 +0000 (08:18 +0100)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Sat, 23 Feb 2019 17:45:05 +0000 (18:45 +0100)
If a link is being built with a site configuration, the
configuration no_cache must be respected.

Resolves: #87728
Releases: master, 9.5
Change-Id: I8d71f11ca953c5744063deec318d9a23c11c1337
Reviewed-on: https://review.typo3.org/c/59715
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Susanne Moog <susanne.moog@typo3.org>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
typo3/sysext/frontend/Classes/Typolink/PageLinkBuilder.php

index 5bdbd7e..63d32ec 100644 (file)
@@ -361,6 +361,11 @@ class PageLinkBuilder extends AbstractTypolinkBuilder
 
         $targetPageId = (int)($page['l10n_parent'] > 0 ? $page['l10n_parent'] : $page['uid']);
         $queryParameters['_language'] = $siteLanguageOfTargetPage;
+
+        if ($conf['no_cache']) {
+            $queryParameters['no_cache'] = 1;
+        }
+
         try {
             $uri = $siteOfTargetPage->getRouter()->generateUri(
                 $targetPageId,