Issue Bug Under Review Quiet

#110905MM relation added in a workspace to an already versioned record is invisible and gets lost on publish

Georg Ringer 10/03/26, 06:09 updated 10/03/26, 06:26

Description

MM rows of records in a workspace point to the workspace uids on both sides: if tt_content:297 has the workspace version 299, its relations in the workspace are the MM rows with uid_foreign = 299.

When a relation to such a record is added in the workspace from the other side, e.g. by creating a new record and selecting tt_content:297 in its local side MM field, the MM row is written with the live uid 297 instead of the version uid 299.

Consequences:

  • In the workspace, the versioned record does not show the new relation, the workspace preview is wrong.
  • When both records are published, publishing the versioned record replaces the MM rows of the live uid by the rows of its version, so the new relation is deleted. The relation is lost even though everything has been published.

How to reproduce

Core functional test fixture EXT:core/Tests/Functional/Fixtures/Extensions/test_mm, data set DataScenarios/ManyToMany/DataSet/ImportDefaultWorkspaces.csv:

  • tx_test_mm.group_mm_1_local (local side, MM_oppositeUsage) <-> tt_content.group_mm_1_foreign (foreign side, MM_opposite_field), MM table group_mm_1_relations_mm

In workspace 1:

  1. Modify tt_content:297 (creates version 299)
  2. Create a new tx_test_mm record (uid 32) with group_mm_1_local = tt_content_297

MM table afterwards:

_.uid_local _.uid_foreign _.sorting _.sorting_foreign
28 297 0 1 live
29 297 0 2 live
32 297 1 0 new relation, points to the live uid
28 299 0 1 version of tt_content:297
29 299 0 2 version of tt_content:297
  1. Workspace preview of page 89: content element 297 lists “Surf A” and “Surf B”, but not the new record
  2. Publish tx_test_mm:32 and tt_content:297: the MM row of tx_test_mm:32 is gone

The opposite direction (new content element related to tx_test_mm:28, which has a workspace version) has the same cause. It is covered by the patch for #105578, which keeps MM rows pointing to workspace records on publish.

Expected behaviour

A relation added in a workspace to a record which has a version in this workspace is stored with the uid of that version, so the version shows it and the relation is moved to the live uid when the version is published.

Reviews 1

History 02