Support Paragraph Library and Embedded Paragraphs

Created on 21 May 2024, 7 months ago
Updated 23 May 2024, 7 months ago

Problem/Motivation

Since Single Content Sync supports Paragraphs out of the box, why not support Embedded Paragraphs and Paragraph Library Items as well?

Steps to reproduce

1. Install Paragraphs Library and Paragraphs Entity Embed modules
2. Create content with a Paragraph from the library
3. Add an embedded paragraph in a ckeditor field
4. Export the node

You'll see that the warning states the 'paragraphs_library_item' and 'embedded_paragraphs' are not exportable out of the box.

Proposed resolution

Add the necessary classes to support these entities. See my patch.

Remaining tasks

User interface changes

API changes

Data model changes

✨ Feature request
Status

Active

Version

1.4

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States ceithamer728

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

Merge Requests

Comments & Activities

  • Issue created by @ceithamer728
  • Pipeline finished with Success
    7 months ago
    Total: 217s
    #178563
  • Pipeline finished with Success
    7 months ago
    Total: 195s
    #180461
  • πŸ‡ΊπŸ‡ΈUnited States ceithamer728

    In my initial patch, I did not take into account that when deleting a node the embedded paragraph entities don't get deleted.

    Upon further testing I realized that importing embedded paragraphs that don't already exist was working and being created correctly but they were not displaying. The below error occurred on page load.

    Drupal\entity_embed\Exception\EntityNotFoundException: Unable to load embedded embedded_paragraphs entity 487e7039-44b4-47aa-80c6-b6f777035c41. in Drupal\paragraphs_entity_embed\Plugin\Filter\ParagraphEmbedFilter->process() (line 154 of /home/ide/project/docroot/modules/contrib/paragraphs_entity_embed/src/Plugin/Filter/ParagraphEmbedFilter.php).

    This is because the ckeditor ParagraphEmbedFilter is looking for data-paragraph-revision-id in the html first and if it finds that id it tries to load that embedded paragraph revision.

    My new commit strips the data-paragraph-revision-id attribute out of the drupal-paragraph element so ParagraphEmbedFilter will load by uuid instead.

    I've attached a patch as well.

Production build 0.71.5 2024