Review main Merged

95619[TASK] Introduce a marker for the "all languages" value

Benni Mack CR +2 V +2 Normal +129 −55 updated 10/06/26, 11:40

Commit message

A record's language field, usually "sys_language_uid", uses -1 to
express that the record is valid in every language of a site. Backend
logic, selectors and filters use the same value to express "all
languages", even where it is not read from a record. That value was
spelled out as a literal in about 50 places across eight system
extensions, which made the concept hard to locate and gives no hint
about its meaning at the call site.

Add \TYPO3\CMS\Core\Schema\LanguageMarker::ALL_LANGUAGES and use it
wherever possible when -1 expresses "all languages", whether the value
is stored in a language field or used synthetically by backend logic,
selectors or filters.

The marker is a class constant and not an enum on purpose: every
other value of a language field is the ID of a site language, so the
field stays an integer and only the reserved value gets a name. That
keeps it usable as an array key and as a query parameter.

The class is marked @internal for now, so the naming can still be
adjusted before it is offered to extension authors.

Behaviour is unchanged. Other uses of -1 that do not express
"all languages" keep the literal.

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Oli Bartsch +1
    • André Buchmann +1
  • Verified V +2 Done
    • Benni Mack +2
    • Oli Bartsch +1
    • André Buchmann +1
    • core-ci +1 CI

Issues 1

Files 34

Show 14 more files

Review log 1114

  1. Benni Mack uploaded patch set 1 09/03/26, 19:49

  2. Benni Mack uploaded patch set 2 09/03/26, 20:00

  3. core-ci voted on patch set 1 V +1 09/03/26, 20:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/107777

  4. core-ci voted on patch set 2 V +1 09/03/26, 20:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/107779

  5. Eric Harrer commented on patch set 2 09/25/26, 14:57

    Hi @benni@typo3.org, quick update from today's Translation Handling Initiative review: We reviewed all `-1` occurrences covered by the current patch and found no false positives. In every case, `-1` semantically means **All Languages**, including cases where the value is used synthetically rather than coming directly from a record's language field. Our extended Core analysis also found additional candidates outside the current patch. I'm going through those now and will add every occurrence that also represents **All Languages**. Once those additions are in, we'll review the expanded patch together once more. We also agreed to use the same marker both for `-1` stored in a record's language field and for synthetic `-1` values used by backend logic, filters or selectors when they mean **All Languages**. We don't want to introduce separate markers for those cases in this patch. We like the idea of introducing a corresponding marker for the default language (`0`) as well. To keep this patch focused on **All Languages** and avoid expanding its scope further, we'd prefer to address that in a separate follow-up patch.
  6. Benni Mack commented on patch set 2 09/30/26, 06:27

    Reply

    sounds good. feel free to push a new patch-set over this patch.
  7. Eric Harrer uploaded patch set 3 V +1 10/02/26, 13:16

  8. core-ci voted on patch set 3 V +1 10/02/26, 13:25 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/109942

  9. Eric Harrer commented on patch set 3 10/02/26, 13:29

    Patchset 3 incorporates the additional cases discussed in today's Translation Handling Initiative review: - Extended the marker usage to further clear `-1 = All Languages` occurrences in TCA, `SlugHelper` and `EditableRestriction`. - Also use the marker for the `> -1` boundary in `EditDocumentController` - Broadened the `LanguageMarker` documentation from record language fields to the agreed semantics, including synthetic backend values. - The TypeScript occurrence keeps the literal `-1`, but now documents its relation to `LanguageMarker::ALL_LANGUAGES`, a shared PHP/TypeScript solution may be a good follow-up. - Updated the commit message to reflect the broader marker scope.
  10. Benni Mack marked it ready for review 10/02/26, 13:34

  11. André Buchmann voted on patch set 3 CR +1 V +1 10/02/26, 13:43

  12. Oli Bartsch commented on patch set 3 CR +1 V +1 10/06/26, 11:29

    LanguageMarker.php:43

    The 14.3 backport has to drop the int.
  13. Benni Mack voted on patch set 3 CR +2 V +2 10/06/26, 11:40

  14. Benni Mack merged patch set 4 10/06/26, 11:40