- Issue created by @relim
- Issue was unassigned.
- Status changed to Needs review
25 days ago 9:26pm 15 August 2025 - First commit to issue fork.
- Merge request !210Issue #3218226: Fix Entity Clone with multiple layout_paragraphs refs โ (Open) created by Unnamed author
- ๐บ๐ธUnited States andrewmriv Southern California
The previous MR in #2 was on the right track โ caching the UUID delta maps so we donโt rebuild them for every paragraph save is a big win on large nodes.
However, the original change used request-wide static caches. This caused cross-field data leakage when cloning nodes that have more than one layout_paragraphs reference field (e.g., a โcontentโ field and a โmodalsโ field). In those cases, the maps built for the first field were reused for subsequent fields, breaking the parent/child structure in the second field.
This MR in #5 keeps the performance improvement while avoiding that regression by:
- Introducing a LayoutParagraphsParentUuidCloneMapper service to encapsulate the mapping logic.
- Caching maps per clone context โ keyed by (source host, destination host, field name) โ so maps are only reused when itโs actually safe.
- Falling back to an unscoped (*) map only if the scoped map does not contain the required UUID, preserving compatibility for edge cases.
- This approach still builds the source and destination maps only once per context, so cloning large, complex nodes remains fast, while ensuring multiple layout_paragraphs fields on the same node clone correctly.