Bug #88490

Wrong site behaviour with empty fallback chain

Added by Alexander Vogt 5 months ago. Updated 5 months ago.

Status:
Resolved
Priority:
Should have
Assignee:
-
Category:
Link Handling, Site Handling & Routing
Target version:
-
Start date:
2019-06-05
Due date:
% Done:

100%

TYPO3 Version:
9
PHP Version:
7.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

When I save the attached language in the backend, I get the following YAML configuration:

  -
    title: US
    enabled: true
    languageId: '5'
    base: /en-us/
    typo3Language: default
    locale: en_US.UTF-8
    iso-639-1: en
    navigationTitle: ''
    hreflang: ''
    direction: ''
    fallbackType: strict
    fallbacks: ''
    flag: us

The empty value is converted to "0" on a call in the frontend and thus a fallback is applied to the default language.

The conversion is done in the site language (TYPO3\CMS\Core\Site\Entity\SiteLanguge):

$fallbackLanguageIds = $configuration['fallbacks'];

if (is_string($fallbackLanguageIds)) {
   $fallbackLanguageIds = explode(',', $fallbackLanguageIds);
}

$this->fallbackLanguageIds = array_map('intval', $fallbackLanguageIds);

fallback.PNG View (31.2 KB) Alexander Vogt, 2019-06-05 08:51

Associated revisions

Revision 7681e206 (diff)
Added by Benni Mack 5 months ago

[BUGFIX] Ensure "0" is treated as proper fallback in site language

Due to incomplete handling of "0" and casting, the fallback
is always "0" which is wrong.

The patch fixes the behavior and adds tests to all use-cases
mentioned in the ticket.

Resolves: #88490
Releases: master, 9.5
Change-Id: Ie685b96a94213104729261daa0e3be6e8ef29c35
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/60879
Tested-by: TYPO3com <>
Tested-by: Daniel Goerz <>
Tested-by: Andreas Fernandez <>
Reviewed-by: Daniel Goerz <>
Reviewed-by: Tobi Kretschmann <>
Reviewed-by: Andreas Fernandez <>

Revision 7829873b (diff)
Added by Benni Mack 5 months ago

[BUGFIX] Ensure "0" is treated as proper fallback in site language

Due to incomplete handling of "0" and casting, the fallback
is always "0" which is wrong.

The patch fixes the behavior and adds tests to all use-cases
mentioned in the ticket.

Resolves: #88490
Releases: master, 9.5
Change-Id: Ie685b96a94213104729261daa0e3be6e8ef29c35
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/60896
Tested-by: TYPO3com <>
Tested-by: Andreas Fernandez <>
Reviewed-by: Andreas Fernandez <>

History

#1 Updated by Gerrit Code Review 5 months ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60879

#2 Updated by Gerrit Code Review 5 months ago

Patch set 1 for branch 9.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/+/60896

#3 Updated by Benni Mack 5 months ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF