Review main Ready for review Quiet

96806[BUGFIX] Write the relation table for single-object MM fields in Extbase

Alexander Schnitzler CR +1 V +1 Hard +371 −3 updated 10/22/26, 19:06

Commit message

A TCA field of type select with a foreign table, an MM table and
maxitems 1 can be mapped to a single domain object property instead
of an ObjectStorage.

DataHandler stores such a relation as a row in the MM table and
writes the number of relations into the field. Setting a record
creates the MM row and writes 1, clearing the relation removes the
MM row and writes 0, replacing the record swaps the MM row.

Extbase treated the property as a plain value. It wrote the uid of
the related object into the field and never touched the MM table,
so a set relation had no MM row, a cleared relation left the old
MM row in place and a replaced relation kept the row of the old
record without a row for the new one.

Extbase now handles a single object or null in a relation table
field like DataHandler does. If the property is new or dirty, it
removes the existing MM rows of the property, persists a new
related object, inserts one MM row for the related object and
writes the number of relations, 0 or 1, into the field.

The functional tests run each scenario through DataHandler and
through Extbase against the same expected result.

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

Review

  • Code review CR +1 Needs a vote
    • Simon Schaufelberger +1
  • Verified V +1 Needs a vote
    • Oliver Klee +1
    • Simon Schaufelberger +1
    • core-ci +1 CI

Merge conflicts 2

Issues 1

Files 13

Review log 46

  1. Alexander Schnitzler uploaded patch set 1 10/18/26, 06:35

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

  3. Alexander Schnitzler uploaded patch set 2 V -1 10/18/26, 07:03

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

  5. Oliver Klee voted on patch set 2 V +1 10/18/26, 09:24

  6. Simon Schaufelberger voted on patch set 2 CR +1 V +1 10/22/26, 19:06