Site encountered error - User create - Drupal 9.5.10

Created on 18 August 2023, over 1 year ago
Updated 3 September 2023, about 1 year ago

Site Encounter issue in user create page after Drupal 9.5.10 upgrade

Update site to 9.5.10 then try to create user via Drupal user interface

Fixed issue via patch. Please validate and port.

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇮🇳India cbuvaneswaran

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

Comments & Activities

  • Issue created by @cbuvaneswaran
  • Status changed to Postponed: needs info over 1 year ago
  • 🇧🇪Belgium RandalV

    Hi @cbuvaneswaran,

    I've tested on several Drupal installs (9.5.10, 10.1.2, 9.3.3) and I cannot reproduce this issue.

    The patch makes sense, but I don't understand in what situation this happens.
    If you look at the MasqueradeRoleUser class (the class that overrides the default User Entity class), you'll see this:

    public function getRoles($exclude_locked_roles = FALSE) {
      if (!$this->roleManager()->isActive($this->id())) {
        return parent::getRoles($exclude_locked_roles);
      }
    
      $roles = $this->roleManager()->getRoles($this->id());
      if ($exclude_locked_roles) {
        unset($roles[RoleInterface::ANONYMOUS_ID]);
        unset($roles[RoleInterface::AUTHENTICATED_ID]);
      }
    
      return $roles;
    }

    This would mean that Masquerade Role is already active for the newly created account?
    Could you test on a fresh 9.5.10 install and see if it happens there too? I have on a few fresh installs and it doesn't.

    If it does happen in a specific situation, could you please explain the exact steps to reproduce? Thanks!

    • RandalV committed 9552c1ba on 1.0.x
      Issue #3381887 by cbuvaneswaran, RandalV: Site encountered error - User...
  • 🇧🇪Belgium RandalV

    Well, I still don't see how Masquerade Role could be active on a new user so if you do figure that out please let me know, but I've pushed a change to the repo that should fix this issue if it does ever occur.

    Thanks for reporting, I won't make a new release yet but if necessary you could use the 1.0.x branch.

  • Status changed to Fixed about 1 year ago
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024