renderCommentField - ajax error when saving new comment with empty display settings

Created on 20 March 2020, over 4 years ago
Updated 17 July 2023, 11 months ago

Ajax error: ResponseText: TypeError: Argument 2 passed to Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay::setComponent() must be of the type array, null given

Patch attached below

πŸ› Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • First commit to issue fork.
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    last update 11 months ago
    2 pass
  • @parisek opened merge request.
  • Status changed to Needs review 11 months ago
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    last update 11 months ago
    2 pass
  • πŸ‡¨πŸ‡ΏCzech Republic parisek

    wangshy thank you, I got same error, created MR with fix inspired by your patch

    ypeError: Drupal\Core\Entity\EntityDisplayBase::setComponent(): Argument #2 ($options) must be of type array, null given, called in /var/www/html/web/core/lib/Drupal/Core/Entity/EntityViewBuilder.php on line 530 in function Drupal\Core\Entity\EntityDisplayBase->setComponent() (line 340 file /var/www/html/web/core/lib/Drupal/Core/Entity/EntityDisplayBase.php)

Production build 0.69.0 2024