Review 14.3 Merged

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

Benni Mack CR +2 V +2 Normal +127 −54 updated 10/06/26, 14:34

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
    • Oli Bartsch +2
    • Georg Ringer +1
  • Verified V +2 Done
    • Oli Bartsch +2
    • Georg Ringer +1
    • core-ci +1 CI

Issues 1

Files 33

Show 13 more files

Review log 710

  1. Benni Mack commented on patch set 1 10/06/26, 11:39

    Cherry Picked from branch main. The following files contain Git conflicts: * typo3/sysext/backend/Classes/Form/FormDataProvider/TcaLanguage.php * typo3/sysext/recycler/Classes/Service/RecyclerService.php
  2. Benni Mack commented on patch set 2 10/06/26, 11:40

    Published edit on patch set 1.
  3. Benni Mack marked it ready for review 10/06/26, 11:41

  4. core-ci voted on patch set 1 V -1 10/06/26, 11:50 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/110219

  5. core-ci voted on patch set 2 V -1 10/06/26, 11:51 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/110220

  6. Benni Mack commented on patch set 3 V -1 10/06/26, 11:55

    Published edit on patch set 2.
  7. core-ci voted on patch set 3 V +1 10/06/26, 12:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/110221

  8. Georg Ringer voted on patch set 3 CR +1 V +1 10/06/26, 13:59

  9. Oli Bartsch voted on patch set 3 CR +2 V +2 10/06/26, 14:34

  10. Oli Bartsch merged patch set 4 10/06/26, 14:34