Workbench Information block cannot be placed with 1.5

Created on 25 October 2024, 28 days ago

Problem/Motivation

Updating to Workbench 8.x-1.5 while using the Workbench Information block on a site will cause it to crash with the following error:

TypeError: Drupal\workbench\Plugin\Block\WorkbenchBlock::__construct(): Argument #1 ($module_handler) must be of type Drupal\Core\Extension\ModuleHandlerInterface, array given, called in /var/www/html/docroot/core/lib/Drupal/Core/Plugin/Factory/ContainerFactory.php on line 25 in Drupal\workbench\Plugin\Block\WorkbenchBlock->__construct() (line 33 of /var/www/html/docroot/modules/contrib/workbench/src/Plugin/Block/WorkbenchBlock.php).

On a site without the block in use, it cannot be placed (fails silently), and that error is logged.

Steps to reproduce

Install Workbench.
Go to block layout.
Place the "Workbench information" block in any region.
Nothing will happen, and an error is logged.

Proposed resolution

Workbench was recently updated to fix some code review errors, and dependency injection was used for the module handler in the block. However, ContainerFactoryPluginInterface was not implemented, so the parameters are not passed correctly to the block constructor.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

1.5

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States byrond

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