Project

General

Profile

Actions

Bug #91230

open

Language menu on mount point page does not generate a valid link

Added by Josef Glatz about 4 years ago. Updated almost 3 years ago.

Status:
New
Priority:
Must have
Assignee:
-
Category:
Frontend
Target version:
-
Start date:
2020-04-29
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
9
PHP Version:
Tags:
menuprocessor,language,lang,mountpoint,mount,mountpointpages,translation
Complexity:
Is Regression:
Yes
Sprint Focus:

Description

Problem/Description

Affects 10.4, 11.x

A language switcher menu based on the MenuProcessor does not generate the correct URL to the default translation of a mount point page which is localized (also the mounted page is localized).

  • The problem occurs no matter if I have a language fallback or not.
  • pages.mount_pid_ol is set value 1 of the mount point page
  • the mount point page and the mounted page are translated (= page translations exists with different slug)

Affected example:

  1. I have a mount point page with URL slug private-pilotes/how-to-buy which results to a URL slug in the frontend of /en/private-pilotes/how-to-buy/ (according to the language site configuration (see below)).
  2. This mount point page is translated. The translated URL slug is privatpiloten/kaufen which results to a URL slug in the frontend of /de/privatpiloten/kaufen/.
  3. The language menu works correctly if you are on the default language of the mount point page /en/private-pilotes/how-to-buy/. Both the link to the default language and the german language is correct and as expected.
  4. But if I'm on the translated mount point page /de/privatpiloten/kaufen/ the link to the default language of the page is /en/privatpiloten/kaufen/ instead of /en/private-pilotes/how-to-buy/

Environment

  • TYPO3 10.4.1/10.4.2-dev
    • didn't tested 9.5 because we updated the instance right from TYPO3 8 LTS where this issue did not occur. Therefore I marked this issue as a regression at least for 10 LTS.
  • Pagetree with Translation
    • default language (english /en/)
    • second language (german /de/)

Extract from the site configuration (language part)

languages:
  -
    title: English
    enabled: true
    languageId: '0'
    base: /en/
    typo3Language: default
    locale: en_CA.UTF-8
    iso-639-1: en
    navigationTitle: English
    hreflang: en-ca
    direction: ltr
    flag: ca
    websiteTitle: ''
  -
    title: Deutsch
    enabled: true
    base: /de/
    typo3Language: de
    locale: de_DE.utf8
    iso-639-1: de
    websiteTitle: ''
    navigationTitle: ''
    hreflang: de-de
    direction: ''
    fallbackType: fallback
    fallbacks: '0'
    flag: de
    languageId: '1'

TypoScript

Using the following dataprocessor Configuration

            # Language Navigation
            page.10.dataProcessing.450 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor
            page.10.dataProcessing.450 {
                special = language
                special.value = 0,1
                as = LanguageNavigation
                if {
                    isTrue = {$site.nav.language.enable}
                }
            }

Acceptance Criteria

A language menu must always link to the correct URL slug of any translation of the actual mount point page no matter which translation of that page is active.


If there are questions or missing details, please also contact me on TYPO3 slack.

Actions

Also available in: Atom PDF