Layout Builder Inline block missing correct interface

Created on 23 June 2025, 19 days ago

Problem/Motivation

When updating an existing Drupal 10.x website to version 10.2.x, the following fatal error occurs:

Uncaught PHP Exception TypeError: "Drupal\layout_builder\Plugin\Block\InlineBlock::__construct(): Argument #7 ($logger) must be of type ?Drupal\layout_builder\Plugin\Block\LoggerInterface, Drupal\Core\Logger\LoggerChannel given, called in /var/www/html/gami-new/web/core/modules/layout_builder/src/Plugin/Block/InlineBlock.php on line 118" at /var/www/html/gami-new/web/core/modules/layout_builder/src/Plugin/Block/InlineBlock.php line 98

This error prevents the site from functioning properly after running database updates.

Steps to reproduce

Update a Drupal 10.x website to version 10.2.x.

Run database updates (e.g., drush updatedb).

Observe the fatal PHP TypeError related to the InlineBlock::__construct() method.

Proposed resolution

Fix the type hint for the $logger parameter in the InlineBlock::__construct() method to use the correct interface (Psr\Log\LoggerInterface) instead of a namespaced LoggerInterface that does not match the injected service.

A patch will be provided to address this issue.

Remaining tasks

Test the patch across different Drupal core and contributed module versions.

Review and merge the patch once confirmed stable.

🐛 Bug report
Status

Active

Version

11.2 🔥

Component

layout_builder.module

Created by

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