Problem/Motivation

Using the SDC Display module to render a paragraph causes the following warning:

Warning: Undefined array key "#view_mode" in Drupal\paragraphs\ParagraphViewBuilder->buildMultiple()
(Line 23 in .../web/modules/contrib/paragraphs/src/ParagraphViewBuilder.php)

Except of the warning everything works fine as expected. (Thank you for this great module :) )

Steps to reproduce

Configure a paragraph type with just the default display mode and assign its fields to a sdc component. Using the paragraph type on any node type leads to the warning.

Proposed resolution

It seems to be caused by paragraphs function that expected the "#view_mode" key in the build array. Adding the key in sdc_display_entity_view_alter solves the issue for me.

Is this the right way of fixing this? Or should paragraphs test for the key?

CommentFileSizeAuthor
sdc_display_view_mode.patch446 bytesdaniel_rempe

Comments

Daniel_Rempe created an issue. See original summary.

  • e0ipso committed 4d0812d2 on 1.x
    Issue #3432236 by Daniel_Rempe: Undefined array key "#view_mode"
    
e0ipso’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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