Project

General

Profile

Actions

Bug #94677

closed

Menu-item of type "shortcut" is language-overlayed twice

Added by Tina Westner over 3 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Site Handling, Site Sets & Routing
Target version:
-
Start date:
2021-07-30
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
11
PHP Version:
Tags:
Complexity:
Is Regression:
Yes
Sprint Focus:

Description

I guess, this is a very detailed scenario and not many people will run into this, but I think I can be simply solved.

In our scenario we have a configuration like this:
domain1 runs with languageId 0.
domain2 runs with languageId 1.
domain3 runs with languageId 2 and has languageId 1 as fallback.

the error is visible while surfing on domain3 with many untranslated pages:
the hmenu renders all default menu items with domain3, but all shortcuts are targeting to domain2 (if they are not translated to language Id 2 and run into the fallback).

the reason for this is, that while generating the shortcut-menu-items the language overlay is done twice and
the link is rendered in languageId 1 instead of languageId 2.

\TYPO3\CMS\Frontend\ContentObject\Menu\AbstractMenuContentObject, line 1371 ff

$shortcut = $tsfe->sys_page->getPageShortcut(...);

the result is a already translated page record with
_PAGES_OVERLAY => TRUE
_PAGES_OVERLAY_UID => ID_OF_ELEMENT_IN_LANGUAGE_ID_1
_PAGES_OVERLAY_LANGUAGE => 1
_PAGES_OVERLAY_REQUESTEDLANGUAGE => 2

afterwards the record is translated again:

if (isset($menuItem['_PAGES_OVERLAY_LANGUAGE'])) {
$shortcut = $tsfe->sys_page->getPageOverlay($shortcut, $menuItem['_PAGES_OVERLAY_LANGUAGE']);
}

it returns:
_PAGES_OVERLAY => TRUE
_PAGES_OVERLAY_UID => ID_OF_ELEMENT_IN_LANGUAGE_ID_1
_PAGES_OVERLAY_LANGUAGE => 1
_PAGES_OVERLAY_REQUESTEDLANGUAGE => 1

for link generation the value of _PAGES_OVERLAY_REQUESTEDLANGUAGE is used, which is wrong and so the wrong domain is used.

IMHO all ways to get through getPageShortcut() will return a already translated page-record, so the if-statement can be deleted.


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #89871: HrefLangGenerator: Wrong links generated with page translations that use a shortcutClosedChristian Eßl2019-12-06

Actions
Actions

Also available in: Atom PDF