Problem/Motivation

There is a strangeness when display empty comments fields, we can't see the comment form.

this is due to an internal bug, side effect of the core function Drupal\Core\Render\Element::isRenderArray used inside ComponentElementBuilder

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

just_like_good_vibes created an issue. See original summary.

just_like_good_vibes’s picture

Assigned: just_like_good_vibes » Unassigned
Status: Active » Needs review
mogtofu33’s picture

Status: Needs review » Reviewed & tested by the community

Fixed the problem, thanks!

just_like_good_vibes’s picture

Status: Reviewed & tested by the community » 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.

lus’s picture

I'm still encountering the problem somehow. I cannot pass through the condition:
if (Element::isRenderArray($data)) {

with a comment field that looks like this:

 array:19 [▼
  "#theme" => "field"
  "#title" => "Commentaires"
  "#label_display" => "above"
  "#view_mode" => "full"
  "#language" => "fr"
  "#field_name" => "field_comments"
  "#field_type" => "comment"
  "#field_translatable" => false
  "#entity_type" => "contribution"
  "#bundle" => "contribution"
  "#object" => 
Drupal\talks\Entity
\
Contribution
 {#3080 ▶}
  "#items" => 
Drupal\comment
\
CommentFieldItemList
 {#4305 ▶}
  "#formatter" => "comment_default"
  "#is_multiple" => false
  "#third_party_settings" => array:1 [▶]
  "#cache" => array:3 [▶]
  0 => array:4 [▼
    "comments" => []
    "comment_form" => array:2 [▶]
    "#comment_type" => "contribution_comment"
    "#comment_display_mode" => 1
  ]
  "#weight" => 8
  "#attributes" => array:1 [▶]
]

And some context: I'm on an entity view display using "field_group" with the "Component" formatter where I pass to the slot my comment field (as a "Field group child" source).

You've got some ideas ?