Duplicating an entity using the entity module doesn't duplicate paragraphs

Created on 12 January 2022, over 3 years ago
Updated 22 August 2024, 9 months ago

Problem/Motivation

We have a site which uses commerce and paragraphs. The commerce products have a feature which allows for duplicating products, using the entity module, however in our testing any paragraphs linked to the products aren't duplicate, but instead the new entity links to the same paragraph entity as the old entity, and as a result, any updates show on both items.

Steps to reproduce

Install commerce_product and paragraphs. Add a paragraph field to a product or product_variation type, the create a product and variation. You should see an option to "Duplicate" the product from the drop button in the product list view. Click on the button, and you will be redirected to a new entity form, for the new entity. Update values, and save the item. View the orginal item, and see that the values were updated here as well.

Proposed resolution

The entity module throws an event when an entity is duplicated. We should subscribe to this event and duplicate any paragraphs in fields referenced by the entity.

Remaining tasks

Review

User interface changes

None

API changes

None

Data model changes

None

πŸ› Bug report
Status

Postponed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States richgerdes New Jersey, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024