Bug #99530
closedFunction getDefaultLanguage returns disabled language
100%
Description
Function TYPO3\CMS\Core\Site\Entity\Site->getDefaultLanguage() (https://github.com/TYPO3/typo3/blob/10.4/typo3/sysext/core/Classes/Site/Entity/Site.php#L255) returns disabled languages. This comes into case when requesting a not existing page, e.g. www.mysite.tld/de_INT/not-existing/. Error handling now tries to resolve requested language (here: https://github.com/TYPO3/typo3/blob/10.4/typo3/sysext/core/Classes/Error/PageErrorHandler/PageContentErrorHandler.php#L210) and this is the disabled language "de_INT".
My site config is:
languages:
-
title: de_INT
enabled: false
languageId: '0'
...
-
title: en_INT
enabled: true
languageId: '1'
...
Function getDefaultLanguage() doesn't respect not enabled languages, so it returns de_INT, but should return en_INT.
This should fix it:
public function getDefaultLanguage(): SiteLanguage {
$siteLanguages = $this->getLanguages();
return = array_values($siteLanguages)[0];
}
Updated by Gerrit Code Review over 1 year ago
- Status changed from New to Under Review
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/77538
Updated by Gerrit Code Review over 1 year ago
Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/77538
Updated by Gerrit Code Review over 1 year ago
Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/77538
Updated by Gerrit Code Review over 1 year ago
Patch set 1 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/77440
Updated by Oliver Bartsch over 1 year ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset e131831e6d3a3b6c5e7390c1a49623d84f24d794.