Project

General

Profile

Actions

Bug #105578

open

Lost MM relations in workspaces

Added by Ruben Zielke 27 days ago. Updated 12 days ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Workspaces
Target version:
-
Start date:
2024-11-12
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
12
PHP Version:
8.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Description

During the publishing process of related records the relations get lost.

Relations between two or more entities (e.g. products and references) are lost as soon as the products and the related references have an editing status in the editorial (non-live) workspace and are subsequently published.

See my TCA attached.

How to reproduce?

Initial situation

Products tx_solutions_domain_model_product
References tx_solutions_domain_model_reference
MM Table tx_solutions_domain_model_product_reference_mm

Products and references are linked via an MM table.
All data is in the live workspace

Products tx_solutions_domain_model_product
uid t3ver_oid t3ver_wsid t3ver_state
1 0 0 0
References tx_solutions_domain_model_reference.
uid t3ver_oid t3ver_wsid t3ver_state
1 0 0 0
2 0 0 0
Relation tx_solutions_domain_model_product_reference_mm
uid_local (product uid) uid_foreign (reference uid)
1 1
1 2

Editing reference

A reference (uid 1) is edited in the Editorial Workspace.
A copy with a new uid 3 of the data record is automatically created.
tx_solutions_domain_model_reference.t3ver_oid = 1
tx_solutions_domain_model_reference.t3ver_wsid = 1
tx_solutions_domain_model_reference.t3ver_state = 1

Products tx_solutions_domain_model_product
uid t3ver_oid t3ver_wsid t3ver_state
1 0 0 0
References tx_solutions_domain_model_reference.
uid t3ver_oid t3ver_wsid t3ver_state
1 0 0 0
2 0 0 0
3 1 1 1
Link tx_solutions_domain_model_product_reference_mm
uid_local (product uid) uid_foreign (reference uid)
1 1
1 2

Editing product

A product (uid 1) is edited in the Editorial Workspace.
A copy with a new uid 2 of the data record is automatically created.
tx_solutions_domain_model_product.t3ver_oid = 1
tx_solutions_domain_model_product.t3ver_wsid = 1
tx_solutions_domain_model_product.t3ver_state = 1

Products tx_solutions_domain_model_product
uid t3ver_oid t3ver_wsid t3ver_state
1 0 0 0
2 1 1 1
References tx_solutions_domain_model_reference.
uid t3ver_oid t3ver_wsid t3ver_state
1 0 0 0
2 0 0 0
3 1 1 1
Relation tx_solutions_domain_model_product_reference_mm
uid_local (product uid) uid_foreign (reference uid)
1 1
1 2
2 3

Publication of the product

The changes to the product are published.
The changes to the data record are transferred from 'uid 2' to 'uid 1'.
In the relation table, the additional entry (uid_local 5) is removed and the original entry uid_local 1 is updated with the uid 4 of the edited reference.
However, the reference uid 3 is not available in the live workspace.

Products tx_solutions_domain_model_product
uid t3ver_oid t3ver_wsid t3ver_state
1 0 0 0
2 1 1 1
References tx_solutions_domain_model_reference.
uid t3ver_oid t3ver_wsid t3ver_state
1 0 0 0
2 0 0 0
3 1 1 1
Relation tx_solutions_domain_model_product_reference_mm
uid_local (product uid) uid_foreign (reference uid)
1 3
1 2
1 3

Publication of the reference

The changes to the reference are published.
The changes to the data record are transferred from uid 3 to uid 1.
There is no change in the relation table.
However, the reference uid 3 is not available in the live workspace.

Products tx_solutions_domain_model_product
uid t3ver_oid t3ver_wsid t3ver_state
1 0 0 0
References tx_solutions_domain_model_reference.
uid t3ver_oid t3ver_wsid t3ver_state
1 0 0 0
2 0 0 0
3 1 1 1
Relation tx_solutions_domain_model_product_reference_mm
uid_local (product uid) uid_foreign (reference uid)
1 3
1 2

I would have expected the entry in the relation table to be updated when publishing the reference.

BTW: If a related record is edited in a non-live workspace, the stored relation is no more visible in the record view (backend). An editor has no information if the relation is really lost or not shown because of the workspace overlay.
May be it is an separate issue.

Please let me know if you need any further information.


Files


Related issues 1 (1 open0 closed)

Related to TYPO3 Core - Bug #81838: Translating workspace record with MM relationsNew2017-07-11

Actions
Actions #1

Updated by Christian Kuhn 12 days ago

Quick feedback, I had a ~2h look at this.

I was able to replay it in a similar but not identical way on a main/v14. Changing the TCA slightly influences details, one area is select-foreign_table vs. group-allowed and then having fieldname/tablename in MM.

Category relations - which are based on similar TCA do not show the behavior and don't loose "existing" connections when the foreign side of a relation is workspace-changed after local side has been workspace-changed. I did not understand why, yet.

I suppose this is a mixture of funny TCA plus a core issue, and we need to sort out details. And we need more functional test preparation: DataScenarios/CategoryManyToMany is currently very similar to DataScenarios/ManyToMany but misses the workspace scenarios. Those should be added, and DataScenarious/ManyToMany should then be changed to no longer use sys_category, but some "own" MM relation by an extension. This would add the test base for a non-sys_category bed we can play with, and to pin point differences to sys_category. I'd say these preparation steps are ~3 days for a dev who know whats going on.

Actions #2

Updated by Christian Kuhn 12 days ago

  • Related to Bug #81838: Translating workspace record with MM relations added
Actions

Also available in: Atom PDF