Skip to content

fix(map): clear modelId recursively on grouped duplicates#234

Draft
vuntz wants to merge 1 commit intodevfrom
MON-181396-map-fix-grouped-duplicate
Draft

fix(map): clear modelId recursively on grouped duplicates#234
vuntz wants to merge 1 commit intodevfrom
MON-181396-map-fix-grouped-duplicate

Conversation

@vuntz
Copy link
Copy Markdown
Member

@vuntz vuntz commented Feb 23, 2026

Description

When copying/pasting or duplicating grouped elements in the MAP editor, clicking save deletes the parent group.

Root cause: When a group is duplicated or copy-pasted, only the top-level cells get their modelId cleared. Children nested inside the group keep their original modelId. On save, both original and cloned children share the same modelId, causing the backend to overwrite the original element's parentId with the clone's group cell ID. The original group then has zero children and disappears.

Fix: Clear modelId recursively on all descendants in Graph.duplicateCells, and recurse into children in the pasteHere and duplicate actions in Actions.js.

Fixes MON-181396

Type of change

  • Patch fixing an issue (non-breaking change)
  • New functionality (non-breaking change)
  • Breaking change (patch or feature) that might cause side effects breaking part of the Software

Target serie

  • 24.04.x
  • 24.10.x
  • 25.10.x
  • master

How this pull request can be tested ?

  1. Open the MAP editor
  2. Create elements and group them
  3. Duplicate the group (Ctrl+D) and save — both groups should persist
  4. Copy (Ctrl+C) and paste (Ctrl+V) the group and save — both groups should persist
  5. Reload the map and verify both groups still exist

When duplicating or copy-pasting grouped elements, only top-level
cells had their modelId cleared. Children nested inside the group
kept their original modelId, causing the backend to overwrite the
original element's parentId on save — deleting the parent group.

Clear modelId recursively on all descendants in Graph.duplicateCells,
and recurse into children in the pasteHere and duplicate actions.

MON-181396
@github-actions
Copy link
Copy Markdown

Logo
Checkmarx One – Scan Summary & Detailsa3900f0e-bfd3-4b5b-ab51-aad152435b67

Great job! No new security vulnerabilities introduced in this pull request

Copy link
Copy Markdown

@Yassir-BenBOUBKER Yassir-BenBOUBKER left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to be tested, i well see tomorrow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants