Error: Call to a member function revokePermission() on null

Created on 8 June 2023, over 1 year ago
Updated 11 November 2023, about 1 year ago

Problem/Motivation

The function user_role_revoke_permissions() does not properly validate that Role::load($rid) returns a non-null value.

Curiously this was fixed for user_role_grant_permissions() in #2474055: Performance regression in contact_help() .

Steps to reproduce

Invoke user_role_revoke_permissions() with a non-existent role id.

Proposed resolution

See attached patch.

🐛 Bug report
Status

Needs work

Version

9.5

Component
User module 

Last updated 1 day ago

Created by

🇸🇪Sweden meanderix

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

Comments & Activities

Production build 0.71.5 2024