Problem/Motivation
Drupal\Core\Render\Component\Exception\InvalidComponentDataException: Unable to render component "ui_suite_bootstrap:grid_row_1". A render array or a scalar is expected for the slot "col_1_content" when using the render element with the "#slots" property in Drupal\Core\Render\Element\ComponentElement->generateComponentTemplate() (line 118 of core/lib/Drupal/Core/Render/Element/ComponentElement.php).
Issue fork ui_patterns-3495982
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
Comment #2
just_like_good_vibesplease add more details to the usecase, not very clear how to reproduce :)
Comment #3
just_like_good_vibesComment #4
grimreaper- Install the standard installation profile
- use a UI Suite theme, like ui_suite_bootstrap (5.1.x)
- in manage display of the article content type, enable Layout Builder on the view mode full
- in Layout Builder add a section from a component, like grid_row_1
- in this section, place the "block" to display the comments field
- keep default settings of the comment field formatter
- save
- error on display
Comment #5
grimreaperComment #6
pdureau commentedComment #7
just_like_good_vibesThis is an horrible SDC bug...
there is a complex render array generated by the comments block, without any comments.
At a certain depth in the render array, there an an empty array as the value of key "comments".
empty arrays are not considered render arrays, and the whole array structure is then considered not being a render array,
and SDC fails with WSOD.
i propose to create a workaround for that case in ui_patterns, but that's clearly not our role.
We will help users, to keep protected from SDC being too strict :(
Comment #8
just_like_good_vibesor maybe just a core bug...
see
Drupal\Core\Render\Element::isRenderArraycalled fromComponentElement::generateComponentTemplate, line 112. the lineElement::isRenderArray($slot_value)is generating the error.Comment #10
just_like_good_vibeshere we go :) normalization of slot, a new add-on. Stronger than before :D
Comment #11
grimreaperThanks, it works now!
Comment #12
just_like_good_vibescoool :)
Comment #14
just_like_good_vibes