I mark this as major because it's a weird and hard-to-debug problem. It gave me an headache to figure out what happened.

Description of the bug: when the cache is flushed, you sometimes end up with a broken or disappeared management menu. This especially happens when I save a view. The management menu, which for me is displayed by the Admin Menu module, only has one link: "Add content".

Cause: admin_landing_page_access() stores in cache the access info, so that it's only calculated once by path and page load. But in the bootstrap phase, XML Sitemap Menu module makes a temporary user switch to anonymous account and calls menu_link_load(), which calls _menu_link_translate(), _menu_check_access() and finally admin_landing_page_access(). So the access info is calculated with the anonymous account, which has access to very few (or none) admin links. Thus the links do not appear.

Fix proposal:
1. Use drupal_static() system so that admin_landing_page_access()'s cache can be flushed by other modules.
2. Use drupal_static_reset() in XML Site Map Menu after the user switch has been reverted.

I open a related issue for XML Site Map.

CommentFileSizeAuthor
#1 xmlsitemap_compatibility-2306823-1.patch376 bytesgaëlg

Comments

gaëlg’s picture

StatusFileSize
new376 bytes
gaëlg’s picture

grisendo’s picture

This is the related issue in XML sitemap module: #2306823: Compatibility with Admin module

sickness29’s picture

Status: Needs review » Closed (outdated)

D7 reached its EOL back in January 2025, and there is no active release for D7 for this module anymore.
Development or support is not planned for D7. All D7-related issues are marked as outdated in a bunch.

Everyone can apply the patch above (not tested by the maintainers, tested by the community) to their D7 projects.
If the issue remains relevant for D10+ versions, merge requests with proposed solutions for a new module version (D10+) are welcome in a new follow-up issue.

Thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.