Hello,

I'm finding that some admin menu items (structure more often than not) and beyond that the entire admin menu bar sometimes just disappear. No obvious cause has been found. Reinstalling the module rectifies the problem.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

cbrantley’s picture

I'm having the same problem. Unfortunately I have customizations to the admin menu that have to be reset whenever this happens. It seems that the menu tree itself is being altered because the disappearing items don't even show up in admin/build/menus and trying to reach the pages directly via url results in 404.

kevinquillen’s picture

Confirmed... same here.

Mirabuck’s picture

We run a multisite install with QA duplicates of our production environment. This is happening for us not on production sites, but on QA sites that grab a fresh copy of the production DBs at midnight every night. We're toggling maintenance mode on in the QA DBs after they're copied over but are otherwise leaving them unchanged.

kevinquillen’s picture

This happens quite often. Is there any fix for this?

Turning off and turning on the admin module 'fixes' the issue but is not acceptable one for clients. Besides that, sometimes you cant even get to the modules page because of Access Denied, and someone has to drop menu_router_build() or similar build function into the code to get it straight.

kevinquillen’s picture

kevinquillen’s picture

Does anyone have a resolution for this??

giuseppe pillera’s picture

I lost the entire "site building" menù (except for Blocks).
Last operations: installing and setting simple_image module and the modules linked (imagecache, imageapi, lightbox2, imagefield and filefield).
But I suspect that the problem was since I moved Create content submenù from navigation to primary link.
I restored the database but I lost 2 days ok work.

Mirabuck’s picture

My solution: replacing admin module with a combination of the Toolbar module and the Seven theme.

redndahead’s picture

Version: 6.x-1.0-beta3 » 6.x-1.x-dev
Status: Active » Needs review
FileSize
1 KB

The fix on this issue worked for me. #633996: admin_landing_page_access menu item not found

Here is the patch.

EvanDonovan’s picture

That seems like a logical fix; but I have, like #8, switched to Toolbar + Seven. (I miss the 2-level Toolbar, though. Maybe the toolbar from Admin 1.0 could be extracted into a separate module from the rest of the code?)

redndahead’s picture

I've already done that. I'll probably upload the code somewhere this week. I'll post here when I do.

EvanDonovan’s picture

@redndahead: You've done that? Awesome! Where do you think that code should go?

redndahead’s picture

Not sure where it should go. It really should fit in toolbar module, but it handles it differently. I'd hate to create another module, but it might have to be done. I'll probably end up posting the code in one of the toolbar modules issues. Let them decide to incorporate it or not.

Once I create a small administration UI then I'll post it up.

EvanDonovan’s picture

@redndahead: Yea, that was what I was wondering, since it seems like it would be very similar to Toolbar module, but (imo) better (especially because of the icons).

redndahead’s picture

micahw156’s picture

FileSize
1.07 KB

@redndahead,

The change from #9 above solved this problem for me. A similar patch was discussed in #633996: admin_landing_page_access menu item not found and a similar fix was committed to the admin-6.x-2.x branch.

Rather than RTBC your #9 patch, I've re-rolled it to include the comment changes that were included in 633996.

I believe this is a partial fix for #508662: admin/content, admin/settings, admin/store paths do not show at all in the admin interface, but there are also caching issues. I'll post an update over there later today.

Micah

micahw156’s picture

Status: Needs review » Needs work
FileSize
1.09 KB

As I just noted on #508662: admin/content, admin/settings, admin/store paths do not show at all in the admin interface, this doesn't completely solve the problem.

I found another query where router_path needs to be changed to link_path, so I rolled a new patch, but it still doesn't fix the whole problem here.

micahw156’s picture

FileSize
1.36 KB

Another roll to include the comment change from 6.x-2.x that I'd used in #16. Sorry.

micahw156’s picture

The changes from #9 and #18 appear to have fixed things so that all of the menus correctly appear in the menu bar and within the main admin menu. However, as I noted in #508662: admin/content, admin/settings, admin/store paths do not show at all in the admin interface, I can still reproduce the "You do not have any administrative items" errors on some sub-menus. For me this predominantly happens in admin/content and admin/settings.

In a nutshell, the same query we altered in #9 also appears in system_admin_menu_block() where it is also throwing the wrong results back. (This might actually be a core bug, but I've looked, and can't find any reference to this outside of the admin module queue.)

I built a small drush script to mimic how system_admin_menu_block_page() tries to build a menu but returns the "no items" error instead. By manipulating the query from system_admin_menu_block() to set $items['mlid'] and $items['menu'] before that function is called, the correct results are returned.

The following test script is run using drush php-script:


/**
 * @file
 * This file is for debugging menu problems related to the Admin Module.
 * See WebAdmin [#290] for details.
 */

global $user;
$user->uid = 1;

$item = menu_get_item('admin/content');

// This line is the original line used in system_admin_menu_block(). It fails when the site is "scrambled" from an update.
// $item += db_fetch_array(db_query("SELECT mlid, menu_name FROM {menu_links} ml WHERE ml.router_path = '%s' AND module = 'system'", $item['path']));

// This method works but is probably a bit unpredictable in its results.
// $item += db_fetch_array(db_query("SELECT mlid, menu_name FROM {menu_links} ml WHERE ml.router_path = '%s' AND module = 'system' ORDER BY mlid", $item['path']));

// This method works and always returns one - and only one - result. This matches the workaround we've applied to admin_landing_page_access().
$item += db_fetch_array(db_query("SELECT mlid, menu_name FROM {menu_links} ml WHERE ml.link_path = '%s' AND module = 'system'", $item['path']));

$content = system_admin_menu_block($item);

print_r(array_keys($content));

Examining the contents of the menu_links for a "broken" site, we see the following:

mysql> SELECT mlid, menu_name, link_path FROM menu_links ml WHERE ml.router_path = 'admin/content' AND module = 'system';
+------+-----------+------------------------------+
| mlid | menu_name | link_path                    |
+------+-----------+------------------------------+
|  614 | admin     | admin/content/backup_migrate |
|  619 | admin     | admin/content/types          |
|  602 | admin     | admin/content                |
+------+-----------+------------------------------+
3 rows in set (0.00 sec)

Running the same query on a site that did not get "broken" I see that the first item returned is the one I wanted:

mysql> SELECT mlid, menu_name, link_path FROM menu_links ml WHERE ml.router_path = 'admin/content' AND module = 'system';
+------+-----------+------------------------------+
| mlid | menu_name | link_path                    |
+------+-----------+------------------------------+
| 1296 | admin     | admin/content                |
| 1308 | admin     | admin/content/backup_migrate |
| 1313 | admin     | admin/content/types          |
+------+-----------+------------------------------+
3 rows in set (0.00 sec)

I have some ideas about how to fix this without hacking core, but I need to do some more testing.

robcarr’s picture

Just applied the patch at #722146-18: Structure menu item or entire admin menu system sometimes disappear.. Didn't work at all for me. Tried all usual suspects (clear cache, rebuild menus, logout etc): no joy.

killua99’s picture

like @arrrgh didn't work for me all that patchs... #722146-18: Structure menu item or entire admin menu system sometimes disappear. And my queue result was

admin/content
admin/content/antispam