[drupal-devel] [bug] Changing roles for a user requires menu cache invalidate

Dries drupal-devel at drupal.org
Thu Jan 27 21:54:48 UTC 2005


 Project:      Drupal
 Version:      cvs
 Component:    user.module
 Category:     bug reports
 Priority:     normal
 Assigned to:  Anonymous
 Reported by:  moshe weitzman
 Updated by:   Dries
 Status:       patch

I think the user module needs more work (last two chunks added by me):


diff -r1.434 user.module
199a200,202
>
>   // Rebuild this user's menu to account for possibly changed
permissions.
>   menu_rebuild($user->uid);
1135,1136d1137
<         // Delete that user's menu cache.
<         cache_clear_all('menu:'. $account->uid);
1442d1442
<     cache_clear_all();


Please verify/update as necessary.  

(I, for one, wouldn't expect menu_rebuild() to flush the page cache.)

Dries



Previous comments:
------------------------------------------------------------------------

December 31, 2004 - 20:46 : moshe weitzman

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.

------------------------------------------------------------------------

January 27, 2005 - 19:34 : JonBob

Attachment: http://drupal.org/files/issues/menu_18.patch (1.51 KB)

Fixed by adding ability to invalidate cache only for one user.

------------------------------------------------------------------------

January 27, 2005 - 21:01 : Anonymous

Don't we also need some code in user.module to call menu_rebuild?

------------------------------------------------------------------------

January 27, 2005 - 21:05 : JonBob

Yes, the patch does that.

-- 
View: http://drupal.org/node/14977
Edit: http://drupal.org/project/comments/add/14977





More information about the drupal-devel mailing list