Canvas service fails to initialize when logger channel factory is overridden

Created on 25 August 2022, about 2 years ago
Updated 24 April 2023, over 1 year ago

Problem/Motivation

If the default logger channel factory service is switched out with something other than Drupal\Core\Logger\LoggerChannelFactory β€” e.g.: when Redirect 404 module is enabled β€” the service will fail to initialize with the following error:

Drupal\canvas_api\CanvasApiService::__construct(): Argument #4 ($loggerChannelFactory) must be of type Drupal\Core\Logger\LoggerChannelFactory, Drupal\redirect_404\Render\Redirect404LogSuppressor given, called in /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php on line 262

Steps to reproduce

Install and enable Redirect 404 (or another module that replaces the default logger channel factory); use the API.

Proposed resolution

Modify the API service to expect an instance of LoggerChannelFactoryInterface instead of LoggerChannelFactory

Remaining tasks

Patch it

User interface changes

None

API changes

None

Data model changes

None

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States tkiehne

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.

Production build 0.71.5 2024