Closed (fixed)
Project:
Drupal core
Component:
user.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
31 Dec 2004 at 18:46 UTC
Updated:
8 Dec 2005 at 20:01 UTC
Jump to comment: Most recent file
When you remove a user from a given role, the effect is often not seen for a long time since the user's menu remains in cache. we should invaidate the menu cache for a user whenh is roles change (or anytime the $user is saved?).
This same bug is apparent when you grant new roles to a user.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | menu_18.patch | 1.51 KB | jonbob |
Comments
Comment #1
jonbob commentedFixed by adding ability to invalidate cache only for one user.
Comment #2
(not verified) commentedDon't we also need some code in user.module to call menu_rebuild?
Comment #3
jonbob commentedYes, the patch does that.
Comment #4
dries commentedI think the user module needs more work (last two chunks added by me):
Please verify/update as necessary.
(I, for one, wouldn't expect menu_rebuild() to flush the page cache.)
Comment #5
jonbob commentedI guess I don't have a strong opinion on this. Calling menu_rebuild() does the necessary cache clearing, but if this is deemed hard to understand, then just clearing the cache may be sufficient. However, we use menu_rebuild() in other places for this purpose; should those be changed to a set of cache clears instead?
The difference between menu_rebuild() and just doing the cache clears is:
- menu_rebuild() fixes the menu for the current page request, not just for future ones.
- menu_rebuild() populates the menu table with newly added module-defined items.
Comment #6
dries commentedWhatever we choose to do, the current patch does not improve consistentcy. Just look at the existing code to clear the menu cache, and unify it into one function.
Comment #7
killes@www.drop.org commentedI guess Dries won't commit it as is.
Comment #8
killes@www.drop.org commentedThis is fixed in cvs.
Comment #9
(not verified) commented