Overview

Clicking duplicate on the Two Column layout crashes the page.

Proposed resolution

I suspect the issue is that the slots and children in the layoutModel data are not being given new UUID's in layoutModelSlice.ts::duplicateNode - a recursive function to rename the UUID's in the layout and create new values with those UUID's in the model is required here

User interface changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

fazilitehreem created an issue. See original summary.

jessebaker’s picture

Issue summary: View changes
jessebaker’s picture

Priority: Normal » Major

utkarsh_33 made their first commit to this issue’s fork.

utkarsh_33’s picture

Assigned: Unassigned » jessebaker
Status: Active » Needs review
jessebaker’s picture

Assigned: jessebaker » utkarsh_33
Status: Needs review » Needs work

This is not passing the tests yet. Please ensure the tests pass before setting status to Needs review.

kristen pol’s picture

I was just able to duplicate a two column component without issue.

kristen pol’s picture

But after duplicating one with components in it, components in the slots are all gone.

wim leers’s picture

I cannot reproduce this either.

wim leers’s picture

Title: Clicking duplicate for two column layout on xb, crashes the site » `Duplicate` action does not generate new UUIDs for components in slots, resulting in duplicate UUIDs
Status: Needs work » Active
Issue tags: -Needs steps to reproduce
StatusFileSize
new229.62 KB

Ah! I can, and the symptoms are actually super obvious:

wim leers’s picture

utkarsh_33’s picture

Assigned: utkarsh_33 » Unassigned

Currently not working on this.

utkarsh_33’s picture

Assigned: Unassigned » utkarsh_33
utkarsh_33’s picture

Assigned: utkarsh_33 » Unassigned
Status: Active » Needs review
utkarsh_33’s picture

Assigned: Unassigned » jessebaker
wim leers’s picture

Assigned: jessebaker » Unassigned
Status: Needs review » Needs work
Issue tags: +Needs tests

Missing unit tests, as mentioned in #12.

utkarsh_33’s picture

Status: Needs work » Needs review

I have tried writing unit tests for the first time, so might not match the coding standards😅. Please review the changes.

balintbrews’s picture

Assigned: Unassigned » balintbrews

Assigning to myself for review.

balintbrews’s picture

Assigned: balintbrews » utkarsh_33
Status: Needs review » Needs work

Great job with the fix, @utkarsh_33! Duplicating components with slots filled with children works after your changes! 🚀 I left you a few comments on the code — fixing one regression and some clean-up remains to be done before we can merge.

utkarsh_33’s picture

Assigned: utkarsh_33 » balintbrews
Status: Needs work » Needs review

I have updated the code according to requested changes.Please review them.Their might be some more feedbacks on 11bd33b4 change, but rest i think i have addressed most of the changes.

wim leers’s picture

Assigned: balintbrews » utkarsh_33
Status: Needs review » Needs work
utkarsh_33’s picture

Assigned: utkarsh_33 » balintbrews
Status: Needs work » Needs review
balintbrews’s picture

Assigned: balintbrews » utkarsh_33
Status: Needs review » Needs work
utkarsh_33’s picture

Assigned: utkarsh_33 » balintbrews
Status: Needs work » Needs review
balintbrews’s picture

Assigned: balintbrews » jessebaker

This looks good to me. Assigning to @jessebaker for a final round of review.

wim leers’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs tests
Parent issue: » #3450592: [META] Front-end Kanban issue tracker

jessebaker’s picture

Assigned: jessebaker » Unassigned
Status: Reviewed & tested by the community » Fixed

Merged!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.