Cloning Entities with Layout Paragraphs breaks structure and moves subparagraphs into Disabled Items

Created on 10 June 2021, about 3 years ago
Updated 26 January 2024, 5 months ago

Problem/Motivation

https://www.drupal.org/project/layout_paragraphs β†’ is becoming more and more popular. Using Quick Node Clone to clone a node containing a layout paragraph results in broken structure as the contained paragraphs are moved into "Disabled Items" region.

Same with entity clone:
The absolutely same thing happens in https://www.drupal.org/project/entity_clone β†’ so if we find the reason, we should fix it in both modules. See the related issue: πŸ› Cloning Entities with Layout Paragraphs breaks structure and moves subparagraphs into Disabled Items Needs review

πŸ› Nested paragraph support RTBC might be related, but the patch didn't fix anything for me.

Steps to reproduce

Use layout_paragraphs (1.x) in an entity
Clone the entity
See the paragraph elements in "Disabled" instead of their parent paragraph (broken structure)

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

RTBC

Version

1.0

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

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.

  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    @DamienMcKenna is #14 meant for Layout Paragraphs 2?
    We should clarify this here and which steps need to be taken to make this bulletproof.

    Being able to clone entities is an essential feature for content editors.

  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    #14 was for compatibility with Layout Paragraphs v1.

  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    Thanks @DamienMcKenna and sorry for my dumb question. So does anyone know if this issue or πŸ› Nested paragraph support RTBC is still required for Paragraphs or Layout Paragraphs 2?

    Would be super nice to close this chapter.

  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    I don't have access to the site that needed the patch, so I don't know if this patch is still needed. However, we weren't using nested paragraphs so didn't run into the other issue.

  • πŸ‡΅πŸ‡ΉPortugal jrochate

    Using this versions:
    - Drupal 10.1.7
    - Quick Node Clone 1.16
    - Layout Paragraphs 2.0.4
    - Paragraphs 1.16

    I have patched with #3183249 but still didn't get paragraphs do be clone inside the LP paragraph.
    When the page's #14 patch, conclude that they can't be applied simultaneously.

    But....

    When applying ONLY this page's #14 patch, the clone works like expected.

    So, thanks to @DamienMcKenna and @Anybody. This could be merged.

  • Status changed to RTBC 5 months ago
  • πŸ‡¬πŸ‡§United Kingdom Hebl

    I can confirm what @jrochate said above.

    Using these versions:
    - Drupal 10.2.2
    - Quick Node Clone 1.17
    - Layout Paragraphs 2.0.4
    - Paragrapghs 1.17

    ...Patch #14 by @DamienMcKenna works, and paragraphs within sections are now being cloned correctly.

    I'm not sure what the next steps are here regarding getting it merged. The code in the patch suggests it should ideally live in the layout_paragraphs module

    Thanks to @DamienMcKenna for the patch :)

Production build 0.69.0 2024