[BUGFIX] Respect link target for individual pages in menu generation 35/52735/2
authorBenjamin Kott <benjamin.kott@wfp2.com>
Sun, 7 May 2017 17:33:30 +0000 (19:33 +0200)
committerJan Helke <typo3@helke.de>
Thu, 11 May 2017 14:08:11 +0000 (16:08 +0200)
The link target configuration for a page was ignored during menu
generation. The link target is now respected and will override the
defined link target for the menu.

Resolves: #81162
Releases: master, 8.7
Change-Id: Iecf45456942c998e4084b95fe3003d2c5dc038db
Reviewed-on: https://review.typo3.org/52735
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Mona Muzaffar <mona.muzaffar@gmx.de>
Tested-by: Mona Muzaffar <mona.muzaffar@gmx.de>
Reviewed-by: Christer V <cvi@systime.dk>
Reviewed-by: Elmar Hinz <t3elmar@gmail.com>
Reviewed-by: Jan Helke <typo3@helke.de>
Tested-by: Jan Helke <typo3@helke.de>
typo3/sysext/frontend/Classes/ContentObject/Menu/AbstractMenuContentObject.php

index 448a113..7635ed5 100644 (file)
@@ -1612,6 +1612,10 @@ abstract class AbstractMenuContentObject
             $addParams .= $this->I['val']['additionalParams'] . $this->menuArr[$key]['_ADD_GETVARS'];
             $LD = $this->menuTypoLink($this->menuArr[$key], $mainTarget, '', '', $overrideArray, $addParams, $typeOverride);
         }
+        // Override default target configuration if option is set
+        if ($this->menuArr[$key]['target']) {
+            $LD['target'] = $this->menuArr[$key]['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'])) {