Problem/Motivation
You cannot update the Layout of a translated entity when you allow layout overrides per entity.
To reproduce:
1. Add a new language and enable translation for the Basic page content type.
2. Enable Layout Builder and tick Allow each content item to have its layout customized.
3. Create a Basic page in its original language.
4. Translate the Basic page to the new language.
5. Update the Layout of the translated node and Save the layout.
Expected result:
The translated node should have its layout updated.
Current behaviour:
The original node layout has been updated.
Layout Builder loads the wrong entity.
Proposed resolution
There are a few things that need to be done:
- Update getSectionListFromId() to load the correct translation of an entity by using EntityRepository::getTranslationFromContext.
- Clone the inline blocks for the translated node, if the original node has an override.
Remaining tasks
Get#3013197: Cloning an implementation of SectionListInterface does not deep clone the Section or SectionComponent objectscommitted.- Write more tests for Inline blocks. <-- We are here.