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?
| Comment | File | Size | Author |
|---|---|---|---|
| sdc_display_view_mode.patch | 446 bytes | daniel_rempe |
Comments
Comment #3
e0ipso