Paragraph cloning fails of the source content does not exist

Created on 25 June 2025, 19 days ago

Problem/Motivation

When adding an existing section/template on a page, it may crash if it contains a paragraph that does not exist.

Steps to reproduce

  1. Create a inline block type with a paragraph reference field.
  2. Create a page, edit layout, add a section with the block and some paragraph.
  3. Save the section or the page template into the library.
  4. Delete the source page.
  5. Try to add the saved section/template on another page.

Proposed resolution

Add a condition to clone paragraphs if they exist in the database.

🐛 Bug report
Status

Needs work

Version

2.0

Component

Code

Created by

🇨🇦Canada franknoel

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

Comments & Activities

  • Issue created by @franknoel
  • 🇮🇳India roshanibhangale

    Hi

    I have tested this on drupal 10 and followed the below steps:

    • Create a inline block type with a paragraph reference field.
    • Create a page, edit layout, add a section with the block and some paragraph.
    • Save the section or the page template into the library.
    • Delete the source page.
    • Try to add the saved section/template on another page.

    After applying patch successfully, observed that even if the main page source is deleted able to add the saved section into the other page.

    Hence this can be moved to RTBC+1. Attaching the screenshot for the reference

    Keeping the ticekt in the Needs review for code review.

Production build 0.71.5 2024