Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
By default the admin menu is cached by:
- The current user id (uid).
- The PHP session id.
- The current language code.
Some implementations will add extra items to the menu (or alter it) based on the context of the page (e.g. Extra menu items when in an Organic Group).
As the admin menu is by default generated and cached once, the context specific items will be missing/out of place unless the cache is cleared.
Proposed resolution
Get the cache id from a helper function that calls a hook to allow other modules to alter the cache id (cid) by adding extra context parameters to it.
Remaining tasks
- Create a function to generate the cache id.
- Replace the code where the cache id is created by the new function.
- Add a drupal_alter() to the helper function so other modules can add extra context to the cache id.
- Document the alter hook in the api documentation.
API changes
Extra hook to alter the cache id.
Comment | File | Size | Author |
---|---|---|---|
#2 | admin_menu_cache_id_alter-2684839-2.patch | 4.09 KB | zero2one |
Comments
Comment #2
zero2one CreditAttribution: zero2one at AmeXio commentedI created a path containing:
Comment #3
truls1502I am sorry for no reply until now.
There are many issues regarding this module admin_menu which is a bit difficult for us to follow up since some of the issues might be already outdated, or is already fixed by the module or any other modules or itself core which means that the problem might no longer need to be fixed.
We can see that the issue has been created for a few years ago, I hope it is okay for you that I am postponing the issue, and give you around two weeks. If you still face the problem, could you tell us the step by step when until you get the error message or what is frustrated you, and a list of modules you are using related to admin_menu and a screenshot that might help us? So it makes us easier to reproduce your issue.
However, after two weeks with no feedback - we will close this issue. So in case, you noticed it after the issue is closed, do not hesitate to reopen it like and fill information which is mentioned above.
So before giving us a feedback, do you mind to test it again with our latest 7.x-3.x-dev?
Thank you for understanding! :)
Comment #4
truls1502This issue has been automatically marked as closed because it has not had recent activity after the last post.
However, if you or someone is still facing the same issue as described to the issue, could you please to re-open the issue by changing the status of the issue, and add an explanation with more details which can help us to reproduce your situation.
Again, thank you for your contributions! :)