Problem/Motivation

This is a minor upgrade issue, but we might as well document it and fix it.

If you are upgrading a Drupal 6 site that had the "Administer" menu item (and tree) moved out of the Navigation menu and into some other menu (like Primary Links, or whatever), then after the upgrade the /admin page will read

You do not have any administrative items.

Navigating to the actual paths works, but they're just not on the /admin page.

Steps to reproduce:
Update a Drupal 6 site which happened to have the Administer menu item somewhere other than the Navigation menu (for example, in a custom menu).

The user might expect a normal upgrade.

Instead, the user will see no entries at /admin after upgrading.

Proposed resolution

Comment #1 offers a workaround:
Before upgrading, use the menu interface at admin/build/menu to reset the "Administer" menu item, which will put it back in the Navigation menu.

Numerous posters confirmed that this solution in comment #19 worked. Run the following code directly against the DB from the command line or using a tool like phpMyAdmin

DELETE FROM menu_links WHERE module = 'system'

Then you need to visit /admin/config/development/performance and clear the cache.

Comment #31 includes a patch with this code. catch wrote that this approach will "destroy people's customized administrative menus on upgrade." sun wrote in response:

Since it would take another one or two years to fix this aspect of the menu system, I'd actually recommend to commit #31. That's our only way to ensure that menu links derived from the menu router are correct when upgrading to D8.

Remaining tasks

Needs an automated test.

Original report by rfay

This is a minor upgrade issue but might as well be documented and perhaps even fixed.

If you are upgrading a Drupal 6 site that had the "Administer" menu item (and tree) moved out of the Navigation menu and into some other menu (like Primary Links, or whatever) then after the upgrade the /admin page will read

You do not have any administrative items.

The actual paths seem to work, they're just not on the /admin page.

What I did: Updated a Drupal 6 site which happened to have the Administer menu item somewhere other than the Navigation menu (it was in a custom menu).

What I expected: A normal upgrade.

What happened instead: I ended up with no entries at /admin.

Note that this was the only recreatable problem in the update of a small D6 site! Yeah!

Upgrading to major... I think this is a huge WTF, as the links are even missing from the administration menu when it's enabled, since they're not properly listed on the /admin page either. If someone upgrades his site, and finds that the links have gone missing, it takes time and effort to find a way to actually administer the site again (tip: look for the "Index" tab on the admin page).

What about after upgrading...? I don't want to have to go back again just to get all the menu items to show up - is there a way to manually reset that menu? I already reset the admin links, and they are in the Management menu.

@rfay/#6 - heh... my approach is usually, "Do the upgrade, and push forward, come Hell or high water! (Then fix bugs later)." I don't like resetting my db and everything, unless the site is for a large, paying client :)

I went into the menu_links table in my database (I used PHPMyAdmin), and changed the mlid of the 'management' menu to 0, and the depth to 0, and now the menu works correctly. I don't know whether the D7 update process needs to make this particular change, or if the code in toolbar_get_menu_tree() should be modified to accept different parameters in the management menu...

[Edit: After I made a change to the menu and saved it, the depth was again set back to '0', so I had to make the change in the DB again; and again, the menu is working.]

I just updated a page on the site, and after saving that page, it's main menu link was removed, and then I noticed that all the 'Management' menu items were somehow magically transferred over to my main menu (which was primary links). When I went to the list links page, none of them had the 'reset' operation available, so it looks like the menu system thought they all belonged there.

I edited the menu and moved my links back to how they should've been, but upon saving the menu, links were moved around magically again, and my main menu links started mingling with other management links (for instance, my 'Contact' link was under the 'Configuration' link parent all of the sudden.

Something seems to be quite messed up on my site (I haven't had any of this behavior on any of my other sites—but those are all fresh D7 sites, not upgrades from D6 to D7).

Of course I made the mistake of changing the administration menu when I was still a beginner in drupal (like 3 years ago).

So I don't expect the upgrade process to magically fix my beginner mistake. But it would be nice to have the drupal 7 upgrade tell you something like :

"Your Drupal 6 administration menu has been customised. You won't have complete access to the drupal 7 administration menu. It is recomended to fix this issue by visiting this page (+link to this issue or another better explanation of the problem)"

1. Try to fix the coupling of /admin with menu links. This is a D8 task at this point.

2. Copy #19.

3. Leave it broken since the approach in #2 is going to destroy people's customized administrative menus on upgrade and they might not appreciate that.

For testing purposes (and to see if it passes the bot), I'm uploading a patch for option #2, overall I don't think we should commit this, unless we're fine losing people's menu link data in order to fix this.

Since it would take another one or two years to fix this aspect of the menu system, I'd actually recommend to commit #31. That's our only way to ensure that menu links derived from the menu router are correct when upgrading to D8.

However, I'd recommend to perform this hard-coded either as the very first step or the very last step in the core upgrade procedure, and delete all corresponding module update code. Not sure which of both makes more sense, but most likely to do it first.

Thanks! #19 works great. If you are in doubt, export the menu_links table before running the command so you have a copy.
After running the query, I received some errors. I ran the update script and everything was fine.

I have a similar issue where if I am logged in and viewing any page on the site, only the shortcut bar has links in it. The admin bar is empty. If I am viewing any administrative page, then all the links in the shortcut and admin bar are there. Tried #19 and no change. Any ideas?

All the right menus items for the administrative toolbar were displayed in the 'Management' menu (.../admin/structure/menu/manage/management), however, the toolbar was empty.

#19 didn't fix for me.
I still had an empty toolbar after updating my database, even after clearing cache as suggested.

What fixed it for me was going back to the 'Management' menu and clicking on 'reset' for all the items and saving the configuration. They remained in the 'Management' menu but this time without the reset link.

After that, I found the 'Administration' menu item under the 'Navigation' menu (.../admin/structure/menu/manage/navigation) and clicked on the reset link alongside. This moved it to the 'Management' menu.

I then used drag/drop to move all the menu items (and their children) to be under 'Administration'

#46 worked for me.
After a drupal 5>6>7 upgrade this did seem sort of minor at first (compared to giving up hundreds of fields and reorganizing the entire image system) but once i started administering the site it got on my nerves real fast.

Way back when I had re-organized this sites admin menus for use with a "simple menu" module back in Drupal 5 (to create a toolbar interface.) "Administration" was its own menu. As per #46 I went to the "Administration" menu under menus in the main navigation: admin/structure/menu

hit the only reset visible and that item reappeared in toolbar and in the "management" menu. once i could see one item in the toolbar I could shuffle around the relevant items into the parent Administration and they appeared in the toolbar.

Unfortunately I hit reset on a number of items which i certainly did not intend to delete, most irritating all the non standard content types. beyond book, page, story etc. Be careful on hitting reset--you really do lose all settings.

Also some errant paths seem to be hardwired incorrectly to the old admin structure. /admin/access. When I have more time i might go into the dbase to fix them but meanwhile I am just grouping them together in orphaned links.

brookfieldCreditAttribution: brookfield as a volunteer commented 28 February 2016 at 18:10

D7 is populating the toolbar with menu children of Management>Administration. Your Administration menu must appear with 'Management' as the 'Parent link', and any items that you want to appear in the toolbar must be set with 'Administration' as the 'Parent link'.

You need to find the menu settings, which may be a little tricky because if you menus have been customized. When I tried following menu trails in other posts, the breadcrumbs were different. The setting for me are under 'Structure>Menus'. When you find it, you will have a table of menu items that can be edited or rearranged. I had trouble finding the 'reset' mentioned in some posts (you will find them when you find the table to edit the menus), but that is not necessary. You do NOT need to follow #19 or 'reset' menu items, though #46 was on the right track. Just edit the menus so that you have the structure 'Management>Administration>(whatever links you want to appear in toolbar).

I have tried the various workarounds listed in the comments, but all I succeeded in doing was deleting the menu links altogether. I had to restore the database table menu-links from a backup. However, I still receive a "500" error whenever I try to access the "Structure" or "Modules" admin links. All the info appears to be correct in the DB, and my PHP memory is 128 MB. Does anybody know what else could cause this issue?

Sam MooreCreditAttribution: Sam Moore as a volunteer commented 12 September 2016 at 00:42

@jrstevens - a 500 is a generic error, but it often betokens some PHP fatal error. Can you see into your PHP error logs?
PHP errors are often logged into the Apache error log, but ask your host.
It would be great if you could identify what threw the error.
Also can you run drush from the command line at all? If so try 'drush cc all' and see if it throws up.

Thank you for your reply and suggestions. Unfortunately, I am on shared hosting with Plesk for Windows so I do not have access to ANY logs of value, nor to Apache, Drush, or some of the critical PHP files. I have been able to check the php settings and they comply with all of the suggestions/solutions I have seen so far. I suspect you are correct that something in php is causing the error, but it is difficult to debug without any access to the log files.

Sam MooreCreditAttribution: Sam Moore as a volunteer commented 18 September 2016 at 14:44

Well if you can't see the logs I'm guessing you can't write your own php,ini values either...
Sorry you're in this situation; shared hosting is a real bear to work with.

You could try asking your hosting service - see if they can make you your own php.ini for your site so that you can manipulate the variables. I'd start with the resource limits variables.
If that's not possible, perhaps they could at least share the logs with you.
Or just find a better host....
Sorry.

I think I'm experiencing this same issue on Drupal 8.4.x. Somewhere along the line, nearly 75% of the admin links got "disabled". If I go into Structure->Menus->Administration, I see a bunch of "Enabled" checkboxes that are not checked.

Unfortunately, checking their boxes (which requires some minor Javascript to efficiently check all those checkboxes since there is no "check all") and saving the menu doesn't do anything (they revert back).

However, if I click on the operations button and choose "Reset", it fixes it and it becomes enabled and reappears on the admin toolbar above. I'd like to avoid resetting hundreds of links, but don't any other way to do it.