#111128Extbase does not write the relation table for an MM field mapped to a single object
Description
A TCA field with MM and maxitems => 1 (for example type=select, renderType=selectSingle, foreign_table, MM) mapped to a single domain object property is persisted differently by Extbase than by DataHandler.
DataHandler stores the relation in the MM table and writes the number of relations into the field. Extbase writes the uid of the related object into the field and never touches the MM table:
| Action | DataHandler | Extbase |
|---|---|---|
| set tag 2 on an empty field | MM row (1, 2), field = 1 | field = 2, no MM row |
| set the property to null | MM row removed, field = 0 | field = 0, MM row stays |
| replace tag 1 by tag 2 | MM row (1, 2) replaces (1, 1), field = 1 | field = 2, MM row (1, 1) stays, no row for tag 2 |
Reading through the MM table (backend, record API, Extbase itself after reload) therefore returns the old relation or none at all.
Reproduce: persist a model with such a property through update() and persistAll() and compare the field and the MM table with the result of the same change through DataHandler.
Reviews 1
History 02
-
Gerrit Code Review pushed patch set 1 for main to change 96806 status
NewUnder Review <span data-processor="relativetime" data-value="2026-10-18T06:35:19+00:00" > 10/18/26, 06:35 </span> -
Gerrit Code Review pushed patch set 2 for main to change 96806 <span data-processor="relativetime" data-value="2026-10-18T07:03:59+00:00" > 10/18/26, 07:03 </span>