Bug #82794

config.sys_language_mode = fallback;3,2 always falls back to "0"

Added by Benni Mack over 1 year ago. Updated 8 months ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
Localization
Start date:
2017-10-17
Due date:
% Done:

100%

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

Description

If a translation (language UID 5) has a TypoScript configuration to `config.sys_language_mode = fallback;3,2` the definition is that if this page is not available in this translation (language=5) then check if a translation for 3 and after that "2" is set. However, if none of the page translations is available, the fallback to "0" always applies.

Imagine a set up like:
- language=0 is german
- language=2 is english-worldwide
- language=3 is english-EN
- language=5 is russian

You would not want to fall back to german AT ALL.

Associated revisions

Revision 113943c6 (diff)
Added by Benni Mack over 1 year ago

[BUGFIX] Do not force content_fallback to default page language

If a page translation is not available, the TypoScript option
`config.sys_language_mode` has the option
`content_fallback;listofuids` to define to which other language
translations should be fallen back.

However, if NONE of the defined page translations are available,
a fallback to the DEFAULT language is made (because the
foreach just does not apply) which can not be stopped at all.

To define an explicit 404 when a translated page NOR its
fallbacks are available the special keyword "pageNotFound" is added,
which can be added to
`config.sys_language_mode = content_fallback;3,2,pageNotFound`
and if none of 3,2 are available, a page not found message
is thrown.

Resolves: #82794
Releases: master, 8.7
Change-Id: I90af4e9f9685ffc7db8c562207e3df08786c0ca9
Reviewed-on: https://review.typo3.org/54426
Tested-by: TYPO3com <>
Tested-by: Sascha Rademacher <>
Reviewed-by: Georg Ringer <>
Tested-by: Georg Ringer <>
Reviewed-by: Susanne Moog <>
Tested-by: Susanne Moog <>

Revision a2bca832 (diff)
Added by Benni Mack over 1 year ago

[BUGFIX] Do not force content_fallback to default page language

If a page translation is not available, the TypoScript option
`config.sys_language_mode` has the option
`content_fallback;listofuids` to define to which other language
translations should be fallen back.

However, if NONE of the defined page translations are available,
a fallback to the DEFAULT language is made (because the
foreach just does not apply) which can not be stopped at all.

To define an explicit 404 when a translated page NOR its
fallbacks are available the special keyword "pageNotFound" is added,
which can be added to
`config.sys_language_mode = content_fallback;3,2,pageNotFound`
and if none of 3,2 are available, a page not found message
is thrown.

Resolves: #82794
Releases: master, 8.7
Change-Id: I90af4e9f9685ffc7db8c562207e3df08786c0ca9
Reviewed-on: https://review.typo3.org/54464
Tested-by: TYPO3com <>
Reviewed-by: Susanne Moog <>
Tested-by: Susanne Moog <>

History

#1 Updated by Benni Mack over 1 year ago

Example TypoScript:

config.sys_language_uid = 0
config.language = de

[globalVar = GP:L = 2]
config.sys_language_uid = 2
config.sys_language_mode = strict
config.language = en

[globalVar = GP:L = 3]
config.sys_language_uid = 3
config.sys_language_mode = content_fallback;2
config.language = en

[globalVar = GP:L = 5]
config.sys_language_uid = 5
config.sys_language_mode = content_fallback;3,2
config.language = en

#2 Updated by Gerrit Code Review over 1 year 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/54426

#3 Updated by Gerrit Code Review over 1 year ago

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

#4 Updated by Gerrit Code Review over 1 year ago

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

#5 Updated by Gerrit Code Review over 1 year ago

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

#6 Updated by Gerrit Code Review over 1 year ago

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

#7 Updated by Gerrit Code Review over 1 year ago

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

#8 Updated by Gerrit Code Review over 1 year ago

Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54464

#9 Updated by Benni Mack over 1 year ago

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

#10 Updated by Sebastian Schmal about 1 year ago

Benni Mack wrote:

Example TypoScript:

config.sys_language_uid = 0
config.language = de

[globalVar = GP:L = 2]
config.sys_language_uid = 2
config.sys_language_mode = strict
config.language = en

[globalVar = GP:L = 3]
config.sys_language_uid = 3
config.sys_language_mode = content_fallback;2
config.language = en

[globalVar = GP:L = 5]
config.sys_language_uid = 5
config.sys_language_mode = content_fallback;3,2
config.language = en

dont work for TYPO3 8 LTS !!! :/
only fix for TYPO3 9 ?

#11 Updated by Benni Mack 8 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF