Review main Ready for review Breaking

97535[!!!][FEATURE] Introduce site language option "languageMode"

Benni Mack CR 0 V 0 Expert +1594 −337 updated 11/20/26, 10:33

Commit message

The fallback types "strict" and "fallback" only differ in whether
untranslated content elements are shown in the default language,
while the fallback chain decides for pages. Page links ignore the
chain. This leads to combinations where pages are rendered but not
linked, or linked but not found, and Extbase used the fallback chain
for records differently than TypoScript.

The new site language option "languageMode" replaces "fallbackType":

- "overlays": translations are overlays of records in the default
  language. The fallback chain decides for pages, content elements
  and links alike: "0" in the chain means "fall back to the default
  language".
- "free": no overlays, and the fallback chain is not used.

Details:

- SiteLanguage converts "fallbackType" if "languageMode" is not set,
  and adapts the fallback chain so that translated pages are rendered
  as before. "fallbackType" and SiteLanguage->getFallbackType() are
  deprecated. Without both options, "overlays" is used.
- LanguageAspectFactory maps "overlays" to the overlay type "mixed"
  if the default language is part of the fallback chain, otherwise
  to "includeFloating".
- A translation that exists but is not visible, for example a hidden
  translation, stops the fallback chain in PageRepository and Extbase:
  the record is not shown. A translation that does not exist lets the
  chain continue.
- PageLinkBuilder only links pages that are rendered in the target
  language.
- Extbase selects records of the default language that are translated
  into a language of the fallback chain, as TypoScript does.
- The site module offers "Language Mode" instead of "Fallback Type",
  shows former configurations converted and stores "languageMode".
- The status report lists site languages that still use
  "fallbackType" in their configuration file.

The changelog entries also describe how overlays and free mode work,
as the reference for future changes.

Test this change

Run a command in your clone of the TYPO3 Core. Then try what the change does and vote on Verified in Gerrit. How to review a patch

Check out patch set 5
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/35/97535/5 && git checkout FETCH_HEAD
Cherry-pick onto main
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/35/97535/5 && git cherry-pick FETCH_HEAD

Review

  • Code review CR 0 Needs a vote
  • Verified V 0 Needs a vote
    • core-ci +1 CI

Merge conflicts 30

Issues 2

Files 38

Show 18 more files

Review log 611

  1. Benni Mack uploaded patch set 1 11/11/26, 11:02

  2. core-ci voted on patch set 1 V -1 11/11/26, 11:13 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114059

  3. Benni Mack rebased onto patch set 2 V -1 11/13/26, 15:11

  4. core-ci voted on patch set 2 V -1 11/13/26, 17:46 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114352

  5. Benni Mack rebased onto patch set 3 V -1 11/14/26, 11:07

  6. core-ci voted on patch set 3 V -1 11/14/26, 11:28 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114440

  7. Benni Mack rebased onto patch set 4 V -1 11/17/26, 20:05

  8. core-ci voted on patch set 4 V -1 11/17/26, 20:16 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114788

  9. Benni Mack uploaded patch set 5 V -1 11/18/26, 07:06

  10. core-ci voted on patch set 5 V +1 11/18/26, 07:13 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114820

  11. André Buchmann commented on patch set 5 11/20/26, 10:33

    site_language.php:138 Unresolved

    As the languageMode=free doesn't support fallbacks, we should hide that field. Optionally, have the status report or a site configuration check report "languageMode free with fallbacks configured" as INFO.

    Feature-111386-IntroduceSiteLanguageOptionLanguageMode.rst:123 Unresolved

    Hidden page translations don't stop the fallback chain. The feature RST says pages, links and menus follow "the rules above". Problem - For records, PageRepository::getRecordOverlay() now selects hidden translations too and stops at the first existing one (RecordAccessVoter). - For pages, PageRepository::getPageOverlaysForLanguage() still excludes hidden translations in the query, so the chain continues. - Example: hidden translation of a page into language 1, fallbacks 0. The page is rendered in the default language, whereas a hidden content element translation is not shown at all. Decision needed - Pages follow the content rule: getPageOverlaysForLanguage() selects hidden translations too and stops at the first existing one. This affects routing, rendering, menus and links together. - Pages keep the current behavior: document the difference in the feature RST and pin it with a test. In addition: The slug of a hidden translation, still resolves. The router matches the hidden translation's slug, then the page overlay skips the hidden translation and renders the default language page under the translation URL.