Review main Abandoned

96966[BUGFIX] Avoid duplicate MM relations when remapping copies

Oli Bartsch CR 0 V 0 Normal +65 −0 updated 10/23/26, 08:20

Commit message

Copying a page that contains a sys_category and a tt_content record
related to it copies both sides of the bidirectional MM relation. Both
sides are then remapped from the original uids to the new ones. After
the mapping, several items of a field can point to the same new
record. RelationHandler::writeMM() inserts each of them, so the second
insert fails with a unique constraint violation on
sys_category_record_mm. Processing stops halfway and the original
content element stays related to the copied category.

DataHandler::remapListedDBRecords_procDBRefs() now removes items
pointing to the same record after remapping MM fields that do not
allow multiple relations. writeMM() then keeps one relation and
deletes the stale ones, and the item count stored on the record is
updated.

Review

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

Issues 1

Files 4

Review log 23

  1. Oli Bartsch uploaded patch set 1 10/21/26, 09:10

  2. core-ci voted on patch set 1 V +1 10/21/26, 10:50 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111984

  3. Oli Bartsch abandoned the change 10/23/26, 08:20