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

CommentFileSizeAuthor
#2 i18n_sso-3421372.patch473 bytesabhishek_gupta1

Issue fork i18n_sso-3421372

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:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Shamrockonov created an issue. See original summary.

abhishek_gupta1’s picture

Status: Active » Needs review
FileSize
473 bytes

@Shamrockonov, I have fixed the issue and created Patch. please kindly review.

Shamrockonov’s picture

Hi @abhishek_gupta1,

Based on hook_user_logout, the $account argument should be of type Drupal\Core\Session\AccountInterface.

I've created a merge request which will need reviewing.

Grimreaper’s picture

Version: 8.x-1.5 » 8.x-1.x-dev
Assigned: Unassigned » Grimreaper
Shamrockonov’s picture

Issue summary: View changes

Grimreaper’s picture

Assigned: Grimreaper » Unassigned
Status: Needs review » Fixed

Thanks for the bug report and the MR.

Creating a new release.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.