Bug #78512
closeddoNotShowLink/doNotLinkIt-items should not be processed as links
0%
Description
The following menu does not have any links to non existing translations in the FE:
lib.langswitch = HMENU lib.langswitch{ special = language special.value = 0,1,2 1 = TMENU 1 { NO.wrapItemAndSub = | #Don't show links to languages without existing translation USERDEF1 = 1 USERDEF1.doNotShowLink = 1 USERDEF1.doNotLinkIt = 1 } }
But the links are still processed, which results in faulty realurl page-paths, if realurl is in use.
Quote from Dmitry Dulepov at https://github.com/dmitryd/typo3-realurl/issues/313#issuecomment-257257509 :
Here is where the link is generated: https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/frontend/Classes/ContentObject/Menu/TextMenuContentObject.php#L88
And doNotShowLink is processed after the link is generated: https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/frontend/Classes/ContentObject/Menu/TextMenuContentObject.php#L133
I would suggest to first check if the links are needed, before they are processed.
Updated by Benjamin Robinson over 7 years ago
I wrote a little bugfix. Since I am not a core developer i can't test it properly or commit it.
Here's my suggestion:
Change line 88 in /typo3/sysext/frontend/Classes/ContentObject/Menu/TextMenuContentObject.php ( https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/frontend/Classes/ContentObject/Menu/TextMenuContentObject.php#L88 ) from ...
$this->I['linkHREF'] = $this->link($key, $this->I['val']['altTarget'], $this->mconf['forceTypeValue']);
... to:
if (!isset($this->I['val']['doNotLinkIt']) && !isset($this->I['val']['doNotShowLink'])) { $this->I['linkHREF'] = $this->link($key, $this->I['val']['altTarget'], $this->mconf['forceTypeValue']); }
Updated by Benjamin Robinson over 7 years ago
- Category deleted (
Link Handling, Site Handling & Routing)
Updated by Susanne Moog about 4 years ago
- Status changed from New to Needs Feedback
Does this also happen with core URL handling since v9?
Updated by Benjamin Robinson about 4 years ago
Susanne Moog wrote:
Does this also happen with core URL handling since v9?
No, v9's core url handling does not cache links like realurl.
Updated by Susanne Moog about 4 years ago
- Status changed from Needs Feedback to Closed
Thanks for your answer. As v8 is in important bugfix and security mode only, I'm going to close this issue at this point. I'd recommend the use of "cweagans/composer-patches" (or similar) in older installations where necessary.