Problem/Motivation

When a block contains paragraphs and we will try to export the Section template with such a block we will get an error
Error: Cannot use object of type __PHP_Incomplete_Class as array in Drupal\entity_reference_revisions\Plugin\DataType\EntityReferenceRevisions->setValue() (line 143 of modules/contrib/entity_reference_revisions/src/Plugin/DataType/EntityReferenceRevisions.php).

Why does this happen? Because “Paragraph” is a new object that will be serialized in the LB field along with the block. This means that when the template is inserted, not only the block but also the paragraphs will be created.

Steps to reproduce

1. make a new content block
2. add paragraph field
3. go to the node LB and add this content block with a filled-in paragraph
4. save section to library or all section to template
5. try to export this tempalte

Proposed resolution

Allow unserialise also Paragraph classes.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

hitchshock created an issue. See original summary.

hitchshock’s picture

Issue summary: View changes
Status: Active » Needs review

nginex made their first commit to this issue’s fork.

  • nginex committed 4877200f on 1.4.x
    Issue #3593487 Allowed also Paragraph class if it exist
    
nginex’s picture

Version: 2.0.x-dev » 1.4.x-dev
Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.