When you clone nodes that contain paragraphs the parent and id of the paragraph aren't updated. Thus on deletion or editing the paragraphs are altered on all nodes containing them.

Comments

StefanPr created an issue. See original summary.

StefanPr’s picture

Status: Active » Needs review
StatusFileSize
new2.24 KB
Anonymous’s picture

Thanks for the patch! I agree it should duplicate the paragraph instead of linking to the old one.

I will try testing soon to make sure it works. Also I realize the module has no tests currently, so if you can add them and Drupal.org runs them it would add some confidence to the patch. I don't think that will stop me from merging this though so that can be extra credit :)

LaurensV’s picture

Thanks for the patch! Really need this functionality. Is this patch already tested?

LaurensV’s picture

Seems to work for normal paragraphs:) Doesn't support nested paragraphs though..

Anonymous’s picture

Status: Needs review » Needs work

Cool, moving this back to needs work for the OP to check into things for nested paragraphs, or someone else if they so please.

Johnny vd Laar’s picture

It also doesn't work with translations.

Johnny vd Laar’s picture

StatusFileSize
new2.53 KB

Attached patch fixes the translation issue for me. It changes the title of all translations and also translates the paragraphs.

Still feels like that all this could should actually be inside the createDuplicate function of Node / Paragraphs tho.

Johnny vd Laar’s picture

Status: Needs work » Needs review

For me the patch worked on nested paragraphs. But the orginal patch did as well.

Anonymous’s picture

Status: Needs review » Fixed

Thanks guys, it works for me.

Status: Fixed » Closed (fixed)

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