[!!!][TASK] Resolve URLs to "Link to external URL"-pages directly 96/43496/3
authorGeorg Ringer <georg.ringer@gmail.com>
Wed, 23 Sep 2015 09:17:32 +0000 (11:17 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Thu, 8 Oct 2015 21:20:17 +0000 (23:20 +0200)
Render the external url directly in menus instead of linking to
the internal page and do a redirect afterwards.

Change-Id: Iff407ae2730bd3c66c5b403030887d9f01758a0b
Resolves: #62812
Releases: master
Reviewed-on: http://review.typo3.org/43496
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/core/Documentation/Changelog/master/Breaking-62812-ResolveMenuUrlsToLinkToExternalPagesDirectly.rst [new file with mode: 0644]
typo3/sysext/frontend/Classes/ContentObject/Menu/AbstractMenuContentObject.php

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 (file)
index 0000000..54ac094
--- /dev/null
@@ -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
index edcb366..68252f2 100644 (file)
@@ -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();