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
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | Screenshot 2024-09-09 at 11.08.01 AM.png | 229.62 KB | wim leers |
| Screenshot 2024-09-06 at 12.46.56 PM.png | 736.4 KB | fazilitehreem |
Issue fork experience_builder-3472507
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
Comment #2
jessebaker commentedComment #3
jessebaker commentedComment #6
utkarsh_33 commentedComment #7
jessebaker commentedThis is not passing the tests yet. Please ensure the tests pass before setting status to Needs review.
Comment #8
kristen polI was just able to duplicate a two column component without issue.
Comment #9
kristen polBut after duplicating one with components in it, components in the slots are all gone.
Comment #10
wim leersI cannot reproduce this either.
Comment #11
wim leersAh! I can, and the symptoms are actually super obvious:
Comment #12
wim leersThis relates to #3472089: Improve/Refactor replaceUUIDsAndUpdateModel() and insertMultipleNodes(), in that we should have unit test coverage for this too.
Comment #13
utkarsh_33 commentedCurrently not working on this.
Comment #14
utkarsh_33 commentedComment #15
utkarsh_33 commentedComment #16
utkarsh_33 commentedComment #17
wim leersMissing unit tests, as mentioned in #12.
Comment #18
utkarsh_33 commentedI have tried writing unit tests for the first time, so might not match the coding standards😅. Please review the changes.
Comment #19
balintbrewsAssigning to myself for review.
Comment #20
balintbrewsGreat 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.
Comment #21
utkarsh_33 commentedI 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.
Comment #22
wim leers@balintbrews' feedback at https://git.drupalcode.org/project/experience_builder/-/merge_requests/2... is not yet addressed.
Comment #23
utkarsh_33 commentedComment #24
balintbrewsComment #25
utkarsh_33 commentedComment #26
balintbrewsThis looks good to me. Assigning to @jessebaker for a final round of review.
Comment #27
wim leersComment #29
jessebaker commentedMerged!