#106633web_layout "Language Comparison > All Languages" shows empty single language site
Description
There is a combination of site and user settings that leads to an empty page module in the “web_layout” module despite there being content (which is visible in web_list).
Given:- it’s a v13 instance
- there is a site A with at least two active languages
- and a site B with only the default language being active
- backend user is allowed to see both those sites and languages (or an admin)
- user goes into module web_layout (Web > Page) on site A and uses the upper dropdown (“actionMenu”) to set
- function to “Language Comparison” and
- language to “All languages”
- (this user preference will be stored in
uc-field into db) - user sees on site A all languages next to each other
- user goes on site B (the one with only one, default lange) and sees nothing (like empty page) but on web_list there is clearly content
- when user goes into their settings and resets their own user settings to default stage, site B shows the content again in web_layout
Since TYPO3 13 the actionMenu settings in web_layout keep being stored in the uc where TYPO3 12 resetted them when switching from a multi-language-site to a single-language-site inside of one TYPO3 instance.
Now during rendering TYPO3 13 realizes “oh, here we only have one language so no need to show the action menu at all and function 2 is no possible option” and switches the function to 1 (TYPO3\CMS\Backend\Controller\PageLayoutController->makeActionMenu). But it doesn’t touch the second setting (language = -1) during any rendering and therefore doesn’t find anything to show for -1.
Given that in our project where we found this, every site has an enabled default language 0, my local patch is very quick and dirty: in @backend/Classes/View/Drawing/BackendLayoutRenderer.php@ after line 63 I hastily added
} else {
$languageId = $context->getDrawingConfiguration()->getSelectedLanguageId();
+ // patching: when not in language comparison mode (anymore) we shouldn't have -1 as selected language
+ if($languageId < 0) {
+ $languageId = $context->getSiteLanguage()->getLanguageId();
+ $context->getDrawingConfiguration()->setSelectedLanguageId($languageId);
+ }
}
This does the trick of setting the language to 0 during rendering without changing the value stored in uc (for us, for now).
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.