When cloning a custom block with a paragraph inside the layout builder, an error occurs indicating that the paragraph cannot be duplicated with the same id and uuid. This occurs because when the block is cloned, the paragraph is copied with the same id and uuid.
Steps to reproduce
- Create a custom block and add a paragraph to it.
- Add the block to the layout builder.
- Clone the block and observe the problem.
Proposed solution
Create a new ID and UUID for the paragraph
Comments
Comment #2
mutasim al-shoura commentedComment #3
mutasim al-shoura commentedComment #4
mutasim al-shoura commentedComment #5
mutasim al-shoura commentedComment #6
proweb.ua commented#4 works
Comment #7
afi13 commentedThank you!
The proposed solution handles only a single valued paragraph field, we have several paragraphs in one field and it clones only the first one.
I added adjustments to the patch to make it work for multiple values too.
Comment #8
mutasim al-shoura commentedI enhanced the handling of multi-paragraph.
Comment #9
afi13 commented