diff --git a/src/EventListener/DataContainer/PageInitializationListener.php b/src/EventListener/DataContainer/PageInitializationListener.php index 77e99c0..82c4468 100644 --- a/src/EventListener/DataContainer/PageInitializationListener.php +++ b/src/EventListener/DataContainer/PageInitializationListener.php @@ -80,16 +80,15 @@ private function handleEditAllMode(): void private function addRootLanguageFields(): void { - PaletteManipulator::create() - ->addField('languageRoot', 'fallback') + $hasLegacyRouting = isset($GLOBALS['TL_DCA']['tl_page']['fields']['disableLanguageRedirect']); + + $pm = PaletteManipulator::create() + ->addField('languageRoot', $hasLegacyRouting ? 'language' : 'fallback') ->applyToPalette('root', 'tl_page') ; if (isset($GLOBALS['TL_DCA']['tl_page']['palettes']['rootfallback'])) { - PaletteManipulator::create() - ->addField('languageRoot', 'fallback') - ->applyToPalette('rootfallback', 'tl_page') - ; + $pm->applyToPalette('rootfallback', 'tl_page'); } }