after a user purchases a certain role (i use UC and a rule to do so) the main menu is not updated automatically. The user had access to everything that belongs to the new role, but the menu only gets updated when i manually clear the cache on the site. In searching for a solution i found this has to do with menu caching. I don't use drush or devel and need a solution that suits a production site. Is it best to completely disable menu caching? And how do i do that? Is there a module for that? Thanx, Cas
1 Answer
You cannot disable menu cache - if you could, Drupal would need to scan all modules on every request and it would kill your site. You can use Cache Actions:
It currently provides actions for:
- Clearing Drupal cache bins
- Clearing CSS/JS cache
- Clearing The cache of specific views
- Clearing The cache of specific panel pages
- Clearing The cache of specific mini panels
Just clear menu cache in the same rule you use to add a role to your user. After adding that role, of course.
-
Any clues on which action to use? I tried cache bins and "cache" as its value, but that doesn't work. There doesn't seem to be a value for menu cache. Also, menu rules (another module i found) lacks an action to clear menu cache. Jul 30, 2013 at 13:06
-
-
Yes. I found a way to enter PHP in an action, by enabling the core module PHP filter. But cache_clear_all('*', 'cache_menu', TRUE); doesn't have any effect. Some other PHP string i can use? Jul 30, 2013 at 13:48
-