[BUGFIX] Fix external page link in menu item 47/56447/5
authorCyril Janody <typo3@cjanody.com>
Mon, 26 Mar 2018 15:05:41 +0000 (11:05 -0400)
committerStefan Neufeind <typo3.neufeind@speedpartner.de>
Fri, 30 Mar 2018 12:14:26 +0000 (14:14 +0200)
Set link target with config.extTarget if none has been specified.

Resolves: #84052
Releases: 8.7

Change-Id: Id18a2588d5fa75f725a95b49e11505fa7cb80b78
Reviewed-on: https://review.typo3.org/56447
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Guido Schmechel <littlegee@web.de>
Tested-by: Guido Schmechel <littlegee@web.de>
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
typo3/sysext/frontend/Classes/ContentObject/Menu/AbstractMenuContentObject.php

index a012971..ad809e2 100644 (file)
@@ -1629,6 +1629,9 @@ abstract class AbstractMenuContentObject
         if ($this->menuArr[$key]['target']) {
             $LD['target'] = $this->menuArr[$key]['target'];
         }
+
+        $tsfe = $this->getTypoScriptFrontendController();
+
         // 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'])) {
@@ -1637,11 +1640,12 @@ abstract class AbstractMenuContentObject
                 $LD['target'] = '';
             } else {
                 $LD['totalURL'] = $this->parent_cObj->typoLink_URL(['parameter' => $this->getSysPage()->getExtURL($this->menuArr[$key])]);
+                if (empty($LD['target']) && !empty($tsfe->extTarget)) {
+                    $LD['target'] = $tsfe->extTarget;
+                }
             }
         }
 
-        $tsfe = $this->getTypoScriptFrontendController();
-
         // Override url if current page is a shortcut
         $shortcut = null;
         if ($this->menuArr[$key]['doktype'] == PageRepository::DOKTYPE_SHORTCUT && $this->menuArr[$key]['shortcut_mode'] != PageRepository::SHORTCUT_MODE_RANDOM_SUBPAGE) {