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.
Hello!
Sometimes menu items in admin menu disappears, and I have nailed it down to the admin_landing_page_access function. The problem is that on line 56 you are fetching a menu item based on router_path but I believe link_path would be the right condition. The reason is the next query search for children and when using router_path the item found could be a children in itself.
After changing line 56 from:
$item = db_fetch_array(db_query("SELECT mlid, menu_name FROM {menu_links} ml WHERE ml.router_path = '%s' AND module = 'system'", $path));
to:
$item = db_fetch_array(db_query("SELECT mlid, menu_name FROM {menu_links} ml WHERE ml.link_path = '%s' AND module = 'system'", $path));
everything starts to function normal again.
Comments
Comment #1
mnlund CreditAttribution: mnlund commentedThis applies to the 2.x version as well. Don't know if it is the right fix but I'm getting all the parent items. Any comments on this?
Comment #2
yhahn CreditAttribution: yhahn commentedThanks for tracking this down, will look at this after the holiday break : )
Comment #3
askibinski CreditAttribution: askibinski commentedI can confirm that this fixed my missing menu items/access denied in 1.0-beta3.
Comment #4
yhahn CreditAttribution: yhahn commentedThank you. Committed http://drupal.org/cvs?commit=296614
Comment #6
micahw156This fix got committed to admin-6.x-2.x but was never back-ported to 6.x-1.x. Please see #722146: Structure menu item or entire admin menu system sometimes disappear. for a discussion of the same change to the 1.x branch.
Comment #7
achtonActually, the commit referenced by yhahn in #4 only fixed half of the issue - the OP noted the first half, yhahn only committed the second half to 6.x-2.x. Se the commit diff for further info.
I can confirm that altering that line as noted in #0 fixes this issue.