Too many clone created for referenced entities on multilingual site

Created on 7 March 2024, 10 months ago

Problem/Motivation

Issue 🐛 Inline Blocks on Layout Builder Fail to Clone Correctly Needs work adds code to set cloned referenced entities to the correct host translation. Previously only the cloned entity in the default language gets cloned references correctly.

Unfortunately, the code causes the references to be cloned multiple time (one for each language). If you have nested referenced (like a paragraph with a media inside), the media gets cloned 4 time, and so on.

Steps to reproduce

On a site with 2 languages try to clone a (translated) node that references a paragraph that references a media. At the end you'll have one cloned node, 2 cloned paragraph and 4 cloned media.

Proposed resolution

Clone the references and then attach them to the translated host entity.

Remaining tasks

Review the MR.

User interface changes

None

API changes

None

Data model changes

None

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇮🇹Italy lussoluca Italy

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024