Starting with Drupal ^11.2 with latest Paragraph do not need Paragraphs duplicates

Created on 16 September 2025, 22 days ago

Problem/Motivation

Starting with 11.2.0 from this issue https://www.drupal.org/project/drupal/issues/3040556 🐛 It is not possible to react to an entity being duplicated Needs work and its change record
https://www.drupal.org/node/3268812
We have hook_entity_duplicate available
And Paragraph already implemented in the latest version https://www.drupal.org/project/paragraphs/issues/3495373 📌 Support duplicate hook Active

This mean with the existing code we'll have more duplications than needed ...
So I think we do not need to run unconditional createDuplicate in cloneParagraphs code anymore.

Steps to reproduce

Use the latest Drupal ^11.2 and latest Paragraphs module versions and chase the duplication process for the paragraphs.

Proposed resolution

Create duplicate only if the paragraph is not new entity.
This is also how Paragraphs checks on its duplication process, and it also shouldn't affect the other code in cloneParagraphs

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Active

Version

1.0

Component

Code

Created by

🇷🇴Romania vasike Ramnicu Valcea

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

Merge Requests

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