Problem/Motivation

When i try to preview a new node when i have nested layouts i get an error:

TypeError: Argument 1 passed to Drupal\layout_paragraphs\LayoutParagraphsLayout::__construct() must implement interface Drupal\Core\Field\EntityReferenceFieldItemListInterface, null given, called in /var/www/html/web/modules/contrib/layout_paragraphs/src/LayoutParagraphsRendererService.php on line 70 in Drupal\layout_paragraphs\LayoutParagraphsLayout->__construct() (Zeile 64 in /var/www/html/web/modules/contrib/layout_paragraphs/src/LayoutParagraphsLayout.php)

It only fails if i try to preview new node, not if the node is already saved.

Steps to reproduce

I've also tried it on simplytest.me

  1. Create new node
  2. add paragraph with a layout
  3. place another paragraph with layout inside a region
  4. try to preview the node
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

Hauke Labs created an issue. See original summary.

hauke-vq’s picture

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

justin2pin’s picture

Status: Active » Needs work
Issue tags: +Needs tests

Thanks @Hauke Labs - this should be fixed in MR but still needs test coverage.

  • justin2pin committed 508a89d on 2.0.x
    Issue #3257758: Error when displaying the node preview when layouts are...
justin2pin’s picture

Status: Needs work » Fixed
Issue tags: -Needs tests

Added tests. Marking as fixed.

Status: Fixed » Closed (fixed)

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