diff --git a/typo3/sysext/frontend/Classes/ContentObject/Menu/AbstractMenuContentObject.php b/typo3/sysext/frontend/Classes/ContentObject/Menu/AbstractMenuContentObject.php index 1d901c8e54a8b664879e0394d9666db8718ad55d..210958dbe568541697d57cad1a6076ef5a050941 100644 --- a/typo3/sysext/frontend/Classes/ContentObject/Menu/AbstractMenuContentObject.php +++ b/typo3/sysext/frontend/Classes/ContentObject/Menu/AbstractMenuContentObject.php @@ -1355,6 +1355,9 @@ abstract class AbstractMenuContentObject [], true ); + if (isset($menuItem['_PAGES_OVERLAY_LANGUAGE'])) { + $shortcut = $tsfe->sys_page->getPageOverlay($shortcut, $menuItem['_PAGES_OVERLAY_LANGUAGE']); + } } catch (\Exception $ex) { } if (!is_array($shortcut)) { @@ -1364,7 +1367,7 @@ abstract class AbstractMenuContentObject // Only setting url, not target $LD['totalURL'] = $this->parent_cObj->typoLink_URL([ 'parameter' => $shortcut['uid'], - 'language' => 'current', + 'language' => $shortcut['_PAGES_OVERLAY_REQUESTEDLANGUAGE'] ?? 'current', 'additionalParams' => $addParams . $this->I['val']['additionalParams'] . $menuItem['_ADD_GETVARS'], 'linkAccessRestrictedPages' => !empty($this->mconf['showAccessRestrictedPages']) ]); diff --git a/typo3/sysext/frontend/Tests/Functional/SiteHandling/LocalizedPageRendering/Fixtures/ScenarioD.yaml b/typo3/sysext/frontend/Tests/Functional/SiteHandling/LocalizedPageRendering/Fixtures/ScenarioD.yaml index fd5fc61222bb5923411b8fe82dfddd3d1374b38c..844262ed94f4e499cf9e22be26cfa36ce891febb 100644 --- a/typo3/sysext/frontend/Tests/Functional/SiteHandling/LocalizedPageRendering/Fixtures/ScenarioD.yaml +++ b/typo3/sysext/frontend/Tests/Functional/SiteHandling/LocalizedPageRendering/Fixtures/ScenarioD.yaml @@ -48,4 +48,7 @@ entities: - self: {id: 1300, title: 'EN: Products', slug: '/products'} languageVariants: - self: {id: 1302, title: 'DE-CH: Produkte', language: 2, slug: '/produkte'} - - self: {id: 1400, title: 'EN: Shortcut to welcome', slug: '/shortcut-to-welcome', type: *pageShortcut, shortcut: 1100, l18n_cfg: 0} + - self: {id: 1400, title: 'EN: Shortcut to welcome', slug: '/shortcut-to-welcome', type: *pageShortcut, shortcut: 1100, l18n_cfg: 0, l10n_state: '{"shortcut":"custom"}'} + - self: {id: 1500, title: 'EN: Company', slug: '/company'} + languageVariants: + - self: {id: 1501, title: 'DE: Unternehmen', language: 1, slug: '/shortcut-to-about', type: *pageShortcut, shortcut: 1200, shortcut_mode: 0, l18n_cfg: 0, l10n_state: '{"shortcut":"custom","shortcut_mode":"custom"}'} diff --git a/typo3/sysext/frontend/Tests/Functional/SiteHandling/LocalizedPageRendering/ScenarioDTest.php b/typo3/sysext/frontend/Tests/Functional/SiteHandling/LocalizedPageRendering/ScenarioDTest.php index d7439c8e6e9afa079a3e5665b21e2668103cf273..0455840c557117010bf0dd33227928d72db84d7a 100644 --- a/typo3/sysext/frontend/Tests/Functional/SiteHandling/LocalizedPageRendering/ScenarioDTest.php +++ b/typo3/sysext/frontend/Tests/Functional/SiteHandling/LocalizedPageRendering/ScenarioDTest.php @@ -29,6 +29,7 @@ namespace TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\LocalizedPageRenderin * Home page is not localized into any language and has l18n_cfg=2 set * "About" page is localized into DE and has l18n_cfg=2 set * "Products" page is localized into DE-CH and has l18n_cfg=2 set + * "Company" page is of type "default" in EN and of type "shortcut" in DE, redirecting to page "About" * * Scenario expectations: * Calling home page in EN renders page in EN @@ -38,6 +39,9 @@ namespace TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\LocalizedPageRenderin * Calling "about" page in EN renders page in EN * Calling "about" page in DE renders page in DE * Calling "about" page in DE-CH renders page in DE-CH + * + * Calling "company" page in EN renders page in EN + * Calling "company" page in DE redirects to page "About" in DE */ class ScenarioDTest extends AbstractLocalizedPagesTestCase { @@ -145,6 +149,7 @@ class ScenarioDTest extends AbstractLocalizedPagesTestCase ['title' => 'EN: About us', 'link' => '/en/about-us'], ['title' => 'EN: Products', 'link' => '/en/products'], ['title' => 'EN: Shortcut to welcome', 'link' => '/en/hello'], + ['title' => 'EN: Company', 'link' => '/en/company'], ], ], [ @@ -154,12 +159,14 @@ class ScenarioDTest extends AbstractLocalizedPagesTestCase ['title' => 'EN: About us', 'link' => '/en/about-us'], ['title' => 'EN: Products', 'link' => '/en/products'], ['title' => 'EN: Shortcut to welcome', 'link' => '/en/hello'], + ['title' => 'EN: Company', 'link' => '/en/company'], ], ], [ 'url' => 'https://acme.com/de/ueber-uns', 'menu' => [ ['title' => 'DE: Ãœber uns', 'link' => '/de/ueber-uns'], + ['title' => 'DE: Unternehmen', 'link' => '/de/ueber-uns'], ], ], [