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

Created on 20 March 2020, almost 5 years ago
Updated 17 July 2023, over 1 year 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 over 1 year ago
    2 pass
  • @parisek opened merge request.
  • Status changed to Needs review over 1 year ago
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    last update over 1 year 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.71.5 2024