Problem

RedirectLogoutSettings::__construct() type-hints the $module_handler parameter with the concrete ModuleHandler class instead of ModuleHandlerInterface.

This causes a fatal error when another module (e.g. hook_event_dispatcher) decorates the module_handler service, because the decorated service no longer passes the instanceof ModuleHandler check.

Steps to reproduce

  1. Install redirect_after_logout 2.0.0 on Drupal 11
  2. Install a module that decorates the module_handler service
  3. Visit /admin/config/system/redirect_after_logout
  4. Fatal error: Argument #3 must be of type ModuleHandler, given ...

Proposed resolution

Replace ModuleHandler with ModuleHandlerInterface in the use statement, docblock, and constructor parameter.

Patch attached.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

ramcodev created an issue. See original summary.

ramcodev’s picture

Issue summary: View changes

mukeshaddweb made their first commit to this issue’s fork.

mukeshaddweb’s picture

Status: Active » Needs review