Use LoggerChannelFactoryInterface

Created on 29 June 2022, over 2 years ago
Updated 9 May 2023, over 1 year ago

Problem/Motivation

The UserManagementService constructor has the LoggerChannelFactory class as one of its dependencies. Using LoggerChannelFactoryInterface seems a better choice.

An example is using the module with redirect_404 module which decorates the logger.factory service using another class: https://git.drupalcode.org/project/redirect/-/blob/8.x-1.x/modules/redir...

Steps to reproduce

Use together with the redirect_404 submodule from redirect .

Proposed resolution

See patch.

Remaining tasks

None.

User interface changes

None.

API changes

Uses LoggerChannelFactoryInterface instead of LoggerChannelFactory. The change is backwards compatible.

Data model changes

None.

🐛 Bug report
Status

Fixed

Version

3.0

Component

Code

Created by

🇩🇰Denmark arnested

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.

  • 🇩🇪Germany Anybody Porta Westfalica

    Just ran into the same issue and can confirm #2 is the correct fix!

    TypeError: Drupal\purge_users\Services\UserManagementService::__construct(): Argument #5 ($logger_factory) must be of type Drupal\Core\Logger\LoggerChannelFactory, Drupal\redirect_404\Render\Redirect404LogSuppressor given, called in /web/core/lib/Drupal/Component/DependencyInjection/Container.php on line 259 in Drupal\purge_users\Services\UserManagementService->__construct() (Zeile 81 in /web/modules/contrib/purge_users/src/Services/UserManagementService.php)

  • 🇳🇱Netherlands bramtenhove

    The same issue occurs in combination with the Monolog module.

    Patch works, LGTM.

  • 🇩🇪Germany Anybody Porta Westfalica

    Thank you @arnested! Fixed :)

  • Status changed to Fixed over 1 year ago
    • Anybody committed d879a31a on 8.x-3.x
      Issue #3293271 by arnested, Anybody: Use LoggerChannelFactoryInterface
      
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024