[BUGFIX] do not override forceTypeValue if no pageType is set 61/56961/2
authorAndreas Allacher <andreas.allacher@hotmail.com>
Sat, 5 May 2018 06:28:45 +0000 (08:28 +0200)
committerMathias Brodala <mbrodala@pagemachine.de>
Mon, 14 May 2018 15:00:41 +0000 (17:00 +0200)
If a link doesn't set a pageType and
there is no target that defines a pageType,
then forceTypeValue needs to be used instead of always
assuming a pageType of 0.

With this fix, it is possible to actually use
the TypoScript option config.forceTypeValue again.

Resolves: #84925
Releases: master, 8.7
Change-Id: Iae6ba57e943489e4d6a6c690a7668d6908d1623e
Reviewed-on: https://review.typo3.org/56961
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Mathias Brodala <mbrodala@pagemachine.de>
Tested-by: Mathias Brodala <mbrodala@pagemachine.de>
typo3/sysext/frontend/Classes/Typolink/PageLinkBuilder.php

index 6a49ecb..0a4262a 100644 (file)
@@ -77,7 +77,7 @@ class PageLinkBuilder extends AbstractTypolinkBuilder
             $sectionMark = '#' . (MathUtility::canBeInterpretedAsInteger($sectionMark) ? 'c' : '') . $sectionMark;
         }
         // Overruling 'type'
-        $pageType = $linkDetails['pagetype'] ?? 0;
+        $pageType = $linkDetails['pagetype'] ?? '';
 
         if (isset($linkDetails['parameters'])) {
             $conf['additionalParams'] .= '&' . ltrim($linkDetails['parameters'], '&');