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

Review main Work in progress Quiet

96459[WIP][BUGFIX] Synchronize children of excluded relations

Benjamin Kott CR 0 V 0 Hard +739 −137 updated 10/07/26, 12:54

Commit message

A reference field declared l10n_mode=exclude is not part of the
translation form, and neither are the child records hanging off it.
Localizing the record gives the translation children of its own, since
a child points at its parent by uid and the translation is a record of
its own, but no backend form shows them.
FieldTranslationBehaviour::Excluded promises that such a field "always
has the same value as the default translation", so what keeps those
children equal to the default language can only be DataMapProcessor.

It did so once, when the children were created, and never again:

* a value changed on a child of the default language never reached the
  child of the translation, and no form existed to correct it there
* a child dropped from the default language stayed attached to the
  translation, because the ids collected for its removal were thrown
  away by the shortcut that returns when only the order of the children
  changed

Every value of such a child is now taken over from the child it was
derived from: out of the data-map where this very save changes it, and
out of storage otherwise. That covers a child just created as well,
because a copy carries what its ancestor has in storage rather than
what the save is about to write there. A child table that knows nothing
about languages is only ever copied, and that is the whole of its case.

Taken over is every field the child table declares, not only the ones
it declares l10n_mode=exclude for. A child with no form of its own has
no field an editor could maintain per language. Left out are the fields
that make it a record of its own: the pointer and sorting fields of the
relation it hangs off, its language fields, and reference fields of its
own. The children of a child are created by the copy that creates their
parent and carry no pointer to the children of the ancestor, so nothing
could pair the two up.

An Important changelog entry is owed and not in here yet: its file name
and its title need a real issue number, which this patch does not have
yet.

synchronizeReferences() is split along the steps it takes, and the set
arithmetic that used to sit between them is now
ChildSynchronizationPlan, compiled out of three lists of ids and
covered by a unit test of its own. What the field says about its
children is read into ChildRelation once instead of in every step. The
dropped deletions fall out of that: the plan states whether there is
anything to apply at all, and obsolete children are part of that
answer.

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

Review

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

Relation chain 2

  1. 96459 [WIP][BUGFIX] Synchronize children of excluded relations This change

  2. main 96458[WIP][TASK] Cover sync of excluded inline children This change is based on it Work in progress Benjamin Kott CR 0 V -1 Normal +218 −0

Files 5

Review log 12

  1. Benjamin Kott uploaded patch set 1 10/07/26, 12:45

  2. core-ci voted on patch set 1 V +1 10/07/26, 12:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/110311