Closed (duplicate)
Project:
Drupal core
Version:
7.x-dev
Component:
user system
Priority:
Critical
Category:
Task
Assigned:
Reporter:
Created:
12 Aug 2009 at 01:31 UTC
Updated:
22 Aug 2009 at 12:56 UTC
Jump to comment: Most recent file
When a user role is deleted, other modules don't get informed, leaving outdated incorrect data in module tables that store user roles relationships.
In core, at least {book_role} and {filter_format} store roles relationships.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | user-roles-API.patch | 6.32 KB | dropcube |
| #1 | hook_user_role_delete.patch | 2.97 KB | dropcube |
Comments
Comment #1
dropcube commentedThis patch introduces
hook_user_role_delete, a hook that would allow modules to act when a use role is deleted.The hook is implemented in filter.module and block.module.
I am marking this critical, to get some attention before the freeze, as this introduces a new hook (API), .
Comment #2
dries commentedI agree that this is a useful function, but shouldn't we have hooks for adding and updating too -- for consistency?
Comment #3
dropcube commentedCurrently, I can't see a case when a module might need to act when a role is updated (role name changed), but might be later. So, yes, for consistency.
Comment #4
dropcube commentedThis patch adds:
- API functions to manipulate user roles:
user_role_load($rid),user_role_save($role),user_role_delete($role)- hooks
hook_user_role_insert($role),hook_user_role_update($role),hook_user_role_delete($role)- Implementation of
hook_user_role_delete()in core modules filter.momdule and block.mdouleComment #5
dropcube commentedtagging
Comment #6
dropcube commentedTagging.
Comment #7
moshe weitzman commented@dropcube could you look at the patch at #300993: User roles and permissions API and borrow the testing code and anything else that makes sense? then continue this fine work here or there.
Comment #8
dropcube commentedOk, I will take that issue, marking this as duplicate.