i18n_sso_user_logout, argument $account should be of type \Drupal\Core\Session\AccountInterface

Created on 14 February 2024, 10 months ago
Updated 4 March 2024, 10 months ago

Problem/Motivation

I have only really noticed this as an issue when using the masquerade module to be fair. But, when attempting to masquerade with the i18n_sso module enabled, I get the following error.

TypeError: i18n_sso_user_logout(): Argument #1 ($account) must be of type Drupal\Core\Session\AccountProxyInterface, Drupal\user\Entity\User given in i18n_sso_user_logout()

I can see the current function definition for i18n_sso's hook_user_logout() hook is
function i18n_sso_user_logout(AccountProxyInterface $account)

when I believe it should be
function i18n_sso_user_logout(AccountInterface $account)
to match the definition provided in hook_user_logout().

Steps to reproduce

Install both the masquerade module and the i18n_sso module.
Log in as an admin user, and attempt to masquerade as another user.

Proposed resolution

Update the type declaration for $account in i18n_sso_user_logout() to be Drupal\Core\Session\AccountInterface

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇬🇧United Kingdom Shamrockonov

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