Merge conflict Gerrit cannot merge this change. It needs a rebase onto main.

Review main Work in progress Quiet

92859[WIP][BUGFIX] Make MM tables language-aware and workspace-aware

Benni Mack CR 0 V -1 Hard +877 −6 updated 10/15/26, 22:33

Commit message

MM intermediate tables now carry sys_language_uid and t3ver_wsid
columns as part of their composite primary key.

RelationHandler writing scopes DELETE/INSERT operations by language
and workspace, preventing cross-context interference when saving
translated or workspace-overlaid records.

For MM tables that are defined via flexforms, this needs
to be handled manually right now.

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 6
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/59/92859/6 && git checkout FETCH_HEAD
Cherry-pick onto main
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/59/92859/6 && git cherry-pick FETCH_HEAD

Review

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

Issues 2

Files 17

Review log 1420

  1. Benni Mack uploaded patch set 1 02/16/26, 17:23

  2. core-ci voted on patch set 1 V -1 02/16/26, 18:01 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/95987

  3. Benni Mack uploaded patch set 2 V -1 02/16/26, 18:44

  4. core-ci voted on patch set 2 V -1 02/16/26, 18:58 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/95993

  5. Benni Mack uploaded patch set 3 V -1 02/16/26, 19:02

  6. core-ci voted on patch set 3 V -1 02/16/26, 19:40 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/95995

  7. Benni Mack uploaded patch set 4 V -1 02/16/26, 23:31

  8. core-ci voted on patch set 4 V -1 02/16/26, 23:44 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/95999

  9. Daniel Windloff commented on patch set 4 02/18/26, 06:56

    Hey Benni, I don't get the solution. If I have two TCA tables, A and B, where A is multilingual and B is monolingual, linked via MM, then in my view there are the following cases: a) From A's perspective: I have a record language and can determine which relations exist. Everything is fine. b) From B's perspective: I don't have a record language and can't select any language. With that, I don't know which language of A the record should select. The limitation to a default language will not show the current relation situation of the record and you can't manage all existing relations from B to A, which is somewhat inconsistent. To solve this kind of problem, the MM column of the non-language-aware table needs a language grouping of all relations, which also feels strange. From my point of view this is a sign of missconfiguration of TCA. I only see to options to get a consistent state here: a) Tables connected via MM relations must be both language aware nor not b) If Table A is language aware and B is not, the MM column in A needs l10n_mode=exclude. Therewith, the column effectivly becames monolingual. Do I miss something? Could enforcing a consistent TCA config via TcaMigration an alternative here?
  10. Benni Mack commented on patch set 4 02/18/26, 10:43

    Reply Unresolved

    if we have LA (Table A) and NLA (Table B), this is a common scenario, which - I think if we forbid it, is bad. I usually have two real-life examples for you in mind: Use-case a: News articles (Table A) and news categories (B) -> both LA. Depending if you translate the categories or not, you always need to get the relation. It doesn't matter if you're checking for the default language news category, or translation, to find the related News articles. Both examples looking from the foreign side (table B uses l10n_mode=exclude or allowLanguageSynchronization) are valid and do not matter when we resolve the data. Use case b: News articles (Table A) and news tags (B) -> LA + NLA. This is totally valid. You don't want a simple structure such as tags to be "translateable", it's just a simple tag / note. instead you just add multiple and different tags to news articles and their translations (local side l10n behavior) - in this case, looking at the foreign side in bidirectional editing does not matter in our case at all.
  11. Benni Mack uploaded patch set 5 V -1 02/18/26, 11:07

  12. core-ci voted on patch set 5 V -1 02/18/26, 11:24 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96121

  13. Benni Mack uploaded patch set 6 V -1 04/14/26, 16:25

  14. core-ci voted on patch set 6 V -1 04/14/26, 16:40 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100175

  15. Christian Kuhn commented on patch set 6 04/16/26, 15:43

    the current state of the patch is that it postulates the two fields are needed, and adds them. there is no implementation to actually update them. i'm only half done with the approach by now, but i'm quite sceptical on it already. i played through various options in my mind and always came to the conclusion the combination of actually connected records can always be determined by reading the mm-table, plus the detail data on the other side. if that is true, more fields in mm table are just duplicated data, which we will have lots of trouble with to keep in sync. i'll look at mm issues in forge now to get a better overview on mm issues in combination especially with localization.

    Important-90430-MmTablesIncludeLanguageAndWorkspaceContext.rst:38 Unresolved

    this is a runtime thing when multiple requests fiddle with the same relations at the same time? if so, it needs to be solved differently and the two new fields don't actually fix the issue. locking and transactions are a general DH issue that needs to be changed on an entirely different level.

    Important-90430-MmTablesIncludeLanguageAndWorkspaceContext.rst:41

    this is the true bug: 'delete-all, then insert my stuff only' must be fixed.

    Important-90430-MmTablesIncludeLanguageAndWorkspaceContext.rst:50

    this makes the solution half baked. *if* we decide for (imho redundant) lang+ws id info within MM, we will most likely end up needing both local+foreign-side fields for both lang+ws.

    Important-90430-MmTablesIncludeLanguageAndWorkspaceContext.rst:103 Unresolved

    and that's bad: relationHandler should only touch the intersection, and must not follow a 'delete-all, insert-my-scope-a-new' approach.

    Important-90430-MmTablesIncludeLanguageAndWorkspaceContext.rst:114

    that's actually already the case, iirc. (but i will recheck): when a record on one side is localized (same for workspaced), then there should be localized-uid to not-localized-uid rows in MM table. and when then later one of the other side is later localied, to, the other-side-uid of those connections should change local-uid. it is possible *this* is currently broken for either workspace or language, or both. will check. and if *that* works, we'll have to look at this: localize-local, workspace-change-local, localize-live-foreign (and i'd bet at least the last scenario will be broken when we look at it).
  16. Christian Kuhn voted on patch set 6 CR -1 04/16/26, 15:43

  17. Benni Mack marked it work in progress 04/21/26, 14:43

  18. Benni Mack commented on patch set 6 04/21/26, 14:45

    Reply

    the idea was to add this change and then build all the bugfixes related to this topic one by one on top of this concept. See related issues in Forge.

    Important-90430-MmTablesIncludeLanguageAndWorkspaceContext.rst:41 Reply Unresolved

    any ideas how then?

    Important-90430-MmTablesIncludeLanguageAndWorkspaceContext.rst:50 Reply Unresolved

    it would start with one half, stabilizing everything related to MM primary, handling the concept of LA -> LA on bidirectional side at the very last point.

    Important-90430-MmTablesIncludeLanguageAndWorkspaceContext.rst:114 Reply Unresolved

    we will run into issues later-on then due to LA/NLA with l10n_mode=exclude + allowLanguageSynchronization
  19. Christian Kuhn wrote 06/18/26, 23:08

    Removed reviewer Christian Kuhn with the following votes: * Code-Review-1 by Christian Kuhn
  20. Benni Mack wrote 10/15/26, 22:33

    Topic set to DataHandler