Closed (fixed)
Project:
Taxonomy Access Control
Version:
7.x-1.x-dev
Component:
Code
Priority:
Minor
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
2 May 2007 at 09:41 UTC
Updated:
3 Apr 2011 at 05:21 UTC
In the same way that hook_taxonomy gets called to update term_access when a term is deleted, term_access should get updated when a role is removed. Currently this only happens when the module is disabled and enabled in function _taxonomy_access_update_db.
Comments
Comment #1
xjmI believe this is still an issue in the 6.x branch; need to test.
Comment #2
xjmWorking on this. (Thank goodness D7 supports foreign keys... if only D6 did.)
Comment #3
xjmI never realized this before, but there are no hooks associated with role deletion:
http://api.drupal.org/api/function/user_admin_role/6
http://api.drupal.org/api/function/user_admin_role_validate/6
http://api.drupal.org/api/function/user_admin_role_submit/6
So, without referential integrity, all we could do is add form overrides to clean out the stale data.
Dialing this down to minor since it doesn't affect functionality and the number of roles tends to be small in comparison to other data types.
Comment #4
xjmComment #5
xjmOne place we might be able to do this cleanup without much overhead is on visits to the admin page. That form already checks the list of existing roles against those found in TAC tables.
Comment #6
keve commentedThere is a need to add
hook_userffor role deletion in TAC. As i see, it is missing.Comment #7
xjmhook_user() doesn't get invoked when a role is deleted, though, not that I can see. (See in http://api.drupal.org/api/function/user_admin_role_submit/6). That's the problem. (There is a hook for it in D7, though.)
Comment #8
keve commentedYou're right. I checked: user_admin_role_submit().
I forget about it. That can be why i have not inserted hook_user into TAC before.
Your idea in comment #5 seems ok. OR we should postpone this until D7 version.
Comment #9
xjmThat seems reasonable too.
Comment #10
xjmComment #11
xjmIn D7 we can merely implement hook_user_role_delete().
Comment #12
xjmhttp://drupalcode.org/project/taxonomy_access.git/commit/775ff2f