[BUGFIX] do not override forceTypeValue if no pageType is set 63/56863/3
authorAndreas Allacher <andreas.allacher@hotmail.com>
Sat, 5 May 2018 06:28:45 +0000 (08:28 +0200)
committerSusanne Moog <susanne.moog@typo3.org>
Thu, 10 May 2018 11:12:50 +0000 (13:12 +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/56863
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Tymoteusz Motylewski <t.motylewski@gmail.com>
Tested-by: Tymoteusz Motylewski <t.motylewski@gmail.com>
Reviewed-by: Mathias Schreiber <mathias.schreiber@typo3.com>
Tested-by: Mathias Schreiber <mathias.schreiber@typo3.com>
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Tested-by: Susanne Moog <susanne.moog@typo3.org>
typo3/sysext/frontend/Classes/Typolink/PageLinkBuilder.php

index 6f0ae4e..a5ba1c5 100644 (file)
@@ -80,7 +80,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'], '&');