0

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 1

0

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.

4
  • 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.
    – caskraker
    Jul 30, 2013 at 13:06
  • @caskraker You are using Drupal 7?
    – Mołot
    Jul 30, 2013 at 13:36
  • 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?
    – caskraker
    Jul 30, 2013 at 13:48
  • In D7 it can be a problem as this module is in alpha stage.
    – Mołot
    Jul 30, 2013 at 13:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.