Project

General

Profile

Actions

Bug #91328

closed

PageLinkBuilder creates broken "translated" Slugs for MountPoints

Added by Steffen Hastädt over 4 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Site Handling, Site Sets & Routing
Start date:
2020-05-07
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
9
PHP Version:
7.3
Tags:
Complexity:
medium
Is Regression:
Yes
Sprint Focus:

Description

I have a page with language menu and MountPoints. The source pages are in a different page tree.

- current root page
   - Page
      - MountPoint (mounts Subpage)
- other root page
   - Page
      - Subpage
         - Page
         - Page
         - Page

The links are generated by a classic TypoScript language menu:
https://docs.typo3.org/m/typo3/guide-frontendlocalization/master/en-us/LanguageMenu/Index.html

Generated with on the page with the default language the menu is generated correctly.

/en/page/subpage/
/sv/sida/delsida/
/no/page/under/

But as soon as the menu is generated on a translated page, all pages are generated with the wrong slug for the mount point.

SV:
/en/sida/delsida/
/sv/sida/delsida/
/no/sida/delsida/

NO:
/en/page/under/
/sv/page/under/
/no/page/under/

This is caused by TYPO3\CMS\Core\Routing\PageRouter::resolveMountPointParameterIntoPageSlug

In this method the target language is not respected and the slug part of the MountPoint is overwritten in the wrong language:

// Get slugs in the translated page
$mountedPage = $pageRepository->getPage($mountedPage);
$mountRoot = $pageRepository->getPage($mountRoot);

The getPage always returns the page with language overlay of the current language and results in the "translated" slug of the mount point.

More clear is this if the mount point is on a different level.

Correct menu in default language:

/en/page/mountpoint/subpage/translation
/no/page/monteringspunkt/under/oversettelse
/sv/sida/monteringspunkt/undersida/translation

Wrong overwritten part by resolveMountPointParameterIntoPageSlug:

SV:
/en/sida/monteringspunkt/subpage/translation
/no/sida/monteringspunkt/under/oversettelse
/sv/sida/monteringspunkt/undersida/translation

NO:
/en/page/monteringspunkt/subpage/translation
/no/page/monteringspunkt/under/oversettelse
/sv/page/monteringspunkt/undersida/translation

Actions

Also available in: Atom PDF