Use AccountProxyInterface rather than AccountProxy

Created on 7 July 2023, 12 months ago

Problem/Motivation

The \Drupal\redirect_node\EventSubscriber\RedirectRedirectNodes throws the following exception when the restrict_by_ip module is installed.

It throws the following exception:

TypeError: Drupal\redirect_node\EventSubscriber\RedirectRedirectNodes::__construct(): Argument #1 ($currentUser) must be of type Drupal\Core\Session\AccountProxy, Drupal\restrict_by_ip\Session\AccountProxy given, called in /app/application/web/core/lib/Drupal/Component/DependencyInjection/Container.php on line 259 in Drupal\redirect_node\EventSubscriber\RedirectRedirectNodes->__construct() (line 44 of /app/application/web/modules/contrib/redirect_node/src/EventSubscriber/RedirectRedirectNodes.php)

Steps to reproduce

Install the restrict_by_ip module.

Proposed resolution

Use AccountProxyInterface rather than AccountProxy for the event subscriber parameter.

Remaining tasks

User interface changes

N/A

πŸ› Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024