[2.0.0-beta2] Undefined array key "bundle" in ComponentBlock

Created on 2 September 2024, 14 days ago
Updated 7 September 2024, 9 days ago

Problem/Motivation

After enabling ui_patterns_block submodule and using components as block on layout builder, I've got the following error:

Undefined array key "bundle" in Drupal\ui_patterns_blocks\Plugin\Block\ComponentBlock->getComponentSourceContexts() (line 137 of modules/contrib/ui_patterns/modules/ui_patterns_blocks/src/Plugin/Block/ComponentBlock.php).

Proposed resolution

On modules/ui_patterns_blocks/src/Plugin/Block/ComponentBlock.php block plugin line 137
replace: if (!$this->context["bundle"] && isset($this->context["entity"]))
by: if (!isset($this->context["bundle"]) && isset($this->context["entity"]))

🐛 Bug report
Status

Closed: duplicate

Version

2.0

Component

Code

Created by

🇲🇦Morocco b.khouy 🇲🇦 Morocco

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024