Review main Merged

91809[BUGFIX] Preserve focused translation when switching to single-language view

Oli Bartsch CR +2 V +2 Normal +73 −7 updated 11/24/25, 16:29

Commit message

When switching from a multi-language view to a
single-language view (e.g. in Page or View module),
the system now correctly preserves the user's
focused translation.

Previously, `getPrimaryLanguageId()` always returned the
first element of selectedLanguageIds, which was mostly
the default as this is automatically added in comparison
views, ignoring which translation the user was actually
working with.

The new logic in PageContext::getPrimaryLanguageId():

- If exactly 1 non-default language is selected => use that translation
- If 0 or 2+ non-default languages are selected => use default (0)

This matches user expectations: when they have
default + one translation selected in comparison
view, switching to single-language view should show
that translation, not fall back to the default.

Review

  • Code review CR +2 Done
    • Oli Bartsch +2
    • Sven Liebert +1
    • Benjamin Kott +1
  • Verified V +2 Done
    • Oli Bartsch +2
    • Sven Liebert +1
    • Benjamin Kott +1
    • core-ci +1 CI

Issues 1

Files 2

Review log 811

  1. Oli Bartsch uploaded patch set 1 11/21/25, 21:15

  2. Oli Bartsch uploaded patch set 2 11/21/25, 21:16

  3. core-ci voted on patch set 1 V +1 11/21/25, 21:24 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/90567

  4. core-ci voted on patch set 2 V +1 11/21/25, 21:25 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/90568

  5. Simon Schaufelberger voted on patch set 2 CR +1 V +1 11/22/25, 07:13

  6. Oli Bartsch rebased onto patch set 3 CR +1 V +1 11/22/25, 16:20

  7. core-ci voted on patch set 3 V +1 11/22/25, 16:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/90661

  8. Sven Liebert voted on patch set 3 CR +1 V +1 11/24/25, 15:32

  9. Benjamin Kott voted on patch set 3 CR +1 V +1 11/24/25, 16:27

  10. Oli Bartsch voted on patch set 3 CR +2 V +2 11/24/25, 16:29

  11. Oli Bartsch merged patch set 4 11/24/25, 16:29