Call to a member function id() on null. PasswordPolicyEventSubscriber.php 140

Created on 26 September 2022, almost 3 years ago
Updated 7 April 2024, over 1 year ago

Problem/Motivation

It was detected while running a pipeline in CircleCi service, specifically running some behat tests. I''m not sure at all what is the exact step but following the code logic it's like the Authenticated user is not an entity. When it tries to load the user it returns null and then it fails with an error.

Steps to reproduce

TBD

Proposed resolution

I'm adding a patch suggesting to verify the $user is an instance of UserInterface.

πŸ› Bug report
Status

Postponed: needs info

Version

3.2

Component

Code

Created by

πŸ‡ͺπŸ‡¨Ecuador afsch Otavalo

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States Kristen Pol Santa Cruz, CA, USA

    Thanks to everyone for the work on this issue.

    I'm going through all the 8.x issues.

    As the 8.x is no longer supported, I'm postponing this issue for now and need feedback as to whether or not this issue is relevant to 4.0.x.

    If it is, please reopen and change the version, make sure the issue summary is clear and complete, including steps to reproduce, and reroll the patch. If it's not, please close.

    If there is no response to this in a month addressing the above, it can be closed.

  • πŸ‡¦πŸ‡ΊAustralia alex.skrypnyk Melbourne

    alex.skrypnyk β†’ made their first commit to this issue’s fork.

  • πŸ‡¦πŸ‡ΊAustralia alex.skrypnyk Melbourne

    This is still relevant in 4.x (tested with 4.0.3)
    I've re-rolled the patch and opened an MR.

    The cases when this happens are very hard to find.
    In my case, particularly, it was triggering an error on accessing `/sites/default/files/styles/thumbnail/public/media-icons/generic/generic.png?itok=En52hDtY` from within a Behat test.

    But in any case - loading a user always needs to check if the result is correct.

Production build 0.71.5 2024