Project

General

Profile

Actions

Bug #78512

closed

doNotShowLink/doNotLinkIt-items should not be processed as links

Added by Benjamin Robinson over 7 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
TypoScript
Target version:
-
Start date:
2016-10-31
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

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.

Actions #1

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']);
            }

Actions #2

Updated by Benjamin Robinson over 7 years ago

  • Category deleted (Link Handling, Site Handling & Routing)
Actions #3

Updated by Riccardo De Contardi over 7 years ago

  • Category set to TypoScript
Actions #4

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?

Actions #5

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.

Actions #6

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.

Actions #7

Updated by Benjamin Robinson about 4 years ago

O.k., thank you.

Actions

Also available in: Atom PDF