Commit 3c4dc4b8 authored by Oliver Bartsch's avatar Oliver Bartsch Committed by Georg Ringer
Browse files

[BUGFIX] Avoid "All languages" option for single language sites

In case a site in the TYPO3 page tree only features the
default language, the module menu of the page module
does no longer add "All languages" as option, since this
led to misbehaviour, e.g. empty views in some cases.

Resolves: #95308
Releases: master
Change-Id: I54f72c99ff5c8511fd119e024493153408be33c3
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/71173

Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Tested-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
Tested-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
Reviewed-by: Simon Schaufelberger's avatarSimon Schaufelberger <simonschaufi+typo3@gmail.com>
Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Reviewed-by: Thomas Löffler's avatarThomas Löffler <loeffler@spooner-web.de>
Reviewed-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
parent e27614cd
......@@ -267,13 +267,17 @@ class PageLayoutController
if (isset($this->availableLanguages[0])) {
$this->MOD_MENU['language'][0] = $this->availableLanguages[0]->getTitle();
}
// We need to add -1 (all) here so a possible -1 value in &SET['language'] will be respected
// by BackendUtility::getModuleData. Actually, this is only relevant if we are dealing with the
// "languages" mode, which however can only be determined, after the MOD_SETTINGS have been calculated
// by BackendUtility::getModuleData => chicken and egg problem. We therefore remove the -1 item from
// the menu again, as soon as we are able to determine the requested mode.
// @todo Replace the whole "mode" handling with some more robust solution
$this->MOD_MENU['language'][-1] = $this->getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_mod_web_list.xlf:multipleLanguages');
// Add special "-1" in case multiple languages exist
if (count($this->availableLanguages) > 1) {
// We need to add -1 (all) here so a possible -1 value in &SET['language'] will be respected
// by BackendUtility::getModuleData. Actually, this is only relevant if we are dealing with the
// "languages" mode, which however can only be determined, after the MOD_SETTINGS have been calculated
// by BackendUtility::getModuleData => chicken and egg problem. We therefore remove the -1 item from
// the menu again, as soon as we are able to determine the requested mode.
// @todo Replace the whole "mode" handling with some more robust solution
$this->MOD_MENU['language'][-1] = $this->getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_mod_web_list.xlf:multipleLanguages');
}
}
// Initialize the available actions
$actions = $this->initActions();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment