diff --git a/typo3/sysext/core/Documentation/Changelog/master/Breaking-62812-ResolveMenuUrlsToLinkToExternalPagesDirectly.rst b/typo3/sysext/core/Documentation/Changelog/master/Breaking-62812-ResolveMenuUrlsToLinkToExternalPagesDirectly.rst new file mode 100644 index 0000000000000000000000000000000000000000..54ac094408921de812f68a81408fd2d98a2c7d32 --- /dev/null +++ b/typo3/sysext/core/Documentation/Changelog/master/Breaking-62812-ResolveMenuUrlsToLinkToExternalPagesDirectly.rst @@ -0,0 +1,9 @@ +======================================================================== +Breaking: #62812 - Resolve URLs to "Link to external URL"-pages directly +======================================================================== + +Description +=========== + +The behaviour of pages with the type "Link to External URL" is changed for menus. Those pages link now directly to +the provided url instead of linking the internal page with a redirect afterwards. \ No newline at end of file diff --git a/typo3/sysext/frontend/Classes/ContentObject/Menu/AbstractMenuContentObject.php b/typo3/sysext/frontend/Classes/ContentObject/Menu/AbstractMenuContentObject.php index edcb3664e41bd4f866217ab9e5fd4e57ceed2234..68252f26f9a79a2a9333a7496b00cbdbe64ac0f8 100644 --- a/typo3/sysext/frontend/Classes/ContentObject/Menu/AbstractMenuContentObject.php +++ b/typo3/sysext/frontend/Classes/ContentObject/Menu/AbstractMenuContentObject.php @@ -1544,11 +1544,17 @@ abstract class AbstractMenuContentObject { $addParams .= $this->I['val']['additionalParams'] . $this->menuArr[$key]['_ADD_GETVARS']; $LD = $this->menuTypoLink($this->menuArr[$key], $mainTarget, '', '', $overrideArray, $addParams, $typeOverride); } - // Override URL if using "External URL" as doktype with a valid e-mail address: - if ($this->menuArr[$key]['doktype'] == PageRepository::DOKTYPE_LINK && $this->menuArr[$key]['urltype'] == 3 && GeneralUtility::validEmail($this->menuArr[$key]['url'])) { - // Create mailto-link using \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::typolink (concerning spamProtectEmailAddresses): - $LD['totalURL'] = $this->parent_cObj->typoLink_URL(array('parameter' => $this->menuArr[$key]['url'])); - $LD['target'] = ''; + // Override URL if using "External URL" + if ($this->menuArr[$key]['doktype'] == PageRepository::DOKTYPE_LINK) { + + if ($this->menuArr[$key]['urltype'] == 3 && GeneralUtility::validEmail($this->menuArr[$key]['url'])) { + // Create mailto-link using \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::typolink (concerning spamProtectEmailAddresses): + $LD['totalURL'] = $this->parent_cObj->typoLink_URL(array('parameter' => $this->menuArr[$key]['url'])); + $LD['target'] = ''; + } else { + $LD['totalURL'] = $this->parent_cObj->typoLink_URL(array('parameter' => $this->getSysPage()->getExtURL($this->menuArr[$key]))); + } + } $tsfe = $this->getTypoScriptFrontendController();