hook_user_load is not triggered for \Drupal::currentUser()

Created on 11 February 2018, about 7 years ago
Updated 20 December 2024, 4 months ago

Due to loading a UserSession Object instead of the User entity, we can't add roles directly to the user entity, and need to use an event to manipulate the UserSession Object. Core issue πŸ“Œ Load user entity in Cookie AuthenticationProvider instead of using manual queries Needs work has been opened to track this, but has not been addressed yet. Once its merged, then we can back this feature out in a future version. However, we may wish to leave it in until a number of version have rolled passed. The current shim, has been written in such a way that the patch to core should not effect how this works.

πŸ“Œ Task
Status

Postponed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States richgerdes New Jersey, USA

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

Comments & Activities

Not all content is available!

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

  • πŸ‡¨πŸ‡­Switzerland berdir Switzerland

    current user is an object that implements AccountInterface. not UserInterface. The core issue will not change that, it will only change the core implementation, but contrib can do whatever. You can not rely on alternative current user implementations to be user entities.

Production build 0.71.5 2024