[BUGFIX] Render correct menu item for broken shortcut 20/40520/2
authorAndreas Wolf <andreas.wolf@typo3.org>
Tue, 16 Jun 2015 16:11:05 +0000 (18:11 +0200)
committerBenjamin Mack <benni@typo3.org>
Mon, 22 Jun 2015 09:07:55 +0000 (11:07 +0200)
In case the target of a shortcut is not set, it must be
ensured that the rendered menu item has valid markup.
This is especially important if submenu items are present.

Resolves: #67563
Releases: master
Change-Id: Ie464658706e6754821849ca7c8e75d0121221272
Reviewed-on: http://review.typo3.org/40520
Reviewed-by: Benjamin Mack <benni@typo3.org>
Tested-by: Benjamin Mack <benni@typo3.org>
typo3/sysext/frontend/Classes/ContentObject/Menu/TextMenuContentObject.php

index 441f9ee..029b791 100644 (file)
@@ -87,6 +87,9 @@ class TextMenuContentObject extends \TYPO3\CMS\Frontend\ContentObject\Menu\Abstr
                                $this->I['val']['additionalParams'] = $this->WMcObj->stdWrap($this->I['val']['additionalParams'], $this->I['val']['additionalParams.']);
                        }
                        $this->I['linkHREF'] = $this->link($key, $this->I['val']['altTarget'], $this->mconf['forceTypeValue']);
+                       if (empty($this->I['linkHREF'])) {
+                               $this->I['val']['doNotLinkIt'] = 1;
+                       }
                        // Title attribute of links:
                        $titleAttrValue = isset($this->I['val']['ATagTitle.']) ? $this->WMcObj->stdWrap($this->I['val']['ATagTitle'], $this->I['val']['ATagTitle.']) . $this->I['accessKey']['alt'] : $this->I['val']['ATagTitle'] . $this->I['accessKey']['alt'];
                        if (strlen($titleAttrValue)) {