I've upgraded my 6.19 core system (without contrib modules) to 7.0rc1 without any database issues. In the new system, however, the menus are badly corrupted:
Navigation:
Add content (node/add)
Add content (node/add)
Add content (node/add)
Add content (node/add)
Add content (node/add)
Add content (node/add)
Benutzerliste (Deaktiviert) (profile)
Blog-Eintrag (node/add/blog)
Newsletter-Ausgabe (node/add/simplenews)
Pressebericht (node/add/bericht)
Seite (node/add/page)
Story (node/add/story)
Tipps zur Erstellung von Inhalten (Deaktiviert) (filter/tips)
Umfrage (node/add/poll)
Umfragen (Deaktiviert) (poll)
Veranstaltung (node/add/event)
Management:
Statusbericht (admin/reports/status)
Verfügbare Aktualisierungen (admin/reports/updates)
...
Hilfe (admin/help)
Verwaltung (admin)
Verwaltung (admin)
Verwaltung (admin)
Verwaltung (admin)
Verwaltung (admin)
Verwaltung (admin)
Verwaltung (admin)
In other words, top-level entries are showing up in duplicates, and sublevel entries are not grouped. Some top-level entries seem to be missing entirely. Navigating to admin yields the error message "no administration objects available".
I've flushed all caches using admin_menu, but to no avail. I also reset every menu entry using all admin/structure/menu/item/*/reset links that were offered by the system.
Comments
Comment #1
bfroehle commentedralphb: I had this problem as well on one site. However looking through the old D6 menu SQL tables revealed that they were also corrupted with duplicate entries.
Comment #2
chx commentedCan you dump the menu_links table and attach compressed?
Comment #3
rfaySee related (non-critical) #865702: Broken admin pages/links after upgrade if "Administer" was not in the "Navigation" menu.
In that case, resetting the menus before upgrading fixed this.
I wonder if we should tell people they have to reset all menus before upgrading? Make a tool to do that?
Comment #4
babbage commentedI wonder if we should tell people they have to reset all menus before upgrading?
That would be horribly unpopular with end users. If indeed the upgrade doesn't work, we just need to make it work.
Comment #5
ralphb commentedOK, but how would I reset the menus? As I said, I flushed the menu cache, and I clicked every "reset" link that was showing next a menu item. This made things worse.
bfroehle is right, though: My D6 menus are also corrupted in that I have some duplicate entries (which I simply "deactivated" so that they weren't showing up). Again, I don't know how to fix this -- these are menu items generated by modules, not custom content.
As for this ticket, does above make this a D6 issue or an upgrade issue? And more importantly, how can I fix my menus? Should I truncate table menu_cache like some articles on the web suggest? (If you still would like the table contents I can attach them later once I have shell access to the database.)
Comment #6
bfroehle commentedralphb: To resolve, I manually hacked the menu_links table in D6... very carefully. I don't know where the corruption came from --- it was present on a site I inherited. I do know that the site started on 6.x, so it wasn't a 5.x->6.x transition bug or anything like that.
Comment #7
mrsinguyen commentedSee: http://drupal.org/node/939050 the primary link and main menu don't integrate when upgrade from d6 to d7. This is error?
Comment #8
verta commentedJust a comment from the gallery - I know my menu table is corrupted as well. I usually don't discover it until well after whatever module I needed is installed and working and by then I have data and no idea how to replicate the error. I do not have time or confidence to hack the table, I just disable menus that don't work.
If there was a menu cleaning tool to run prior to attempting an upgrade, I'd run it, if only to get through an upgrade attempt. I can rebuild my menus if I have to.
Comment #9
chx commentedYes we still need and badly your database dump.
Comment #10
ralphb commentedOK, here are the dumps of the D6 system right before the upgrade as well as the D7 system right after the upgrade and after resetting the menu items.
Please let me know if you require additional tables from me.
Comment #11
bfroehle commented@mrsinguyen in #7: That issue is different than what I experienced.
Comment #12
pillarsdotnet commentedSuggestion for moving forward (gonna try it myself; will post back here afterwards)
1. Try the upgrade and document the things that fail (a *lot* in my case...)
2. Dump your data, then edit the dump file to remove the menu tables (which are those?)
3. Create a new, blank Drupal-7 site and add the necessary modules.
4. Restore your data from the dump file.
Comment #13
chx commentedI am won't fixing this until a usable bug report appears. The bug report claims not using a contrib module then says "I've flushed all caches using admin_menu, but to no avail". Contradictory. Edit: also the menu_links table is full of contrib modules so I can't blame admin_menu alone but it's suspect at least.
Then comes " My D6 menus are also corrupted in that I have some duplicate entries (which I simply "deactivated" so that they weren't showing up)." I can see that they are corrupted, there four system module owned, customized (changed link_title) menu links pointing to 'admin'. I have no idea how could you get there. Here are the relevant pieces from
_menu_navigation_links_rebuild:and
Comment #14
ralphb commentedchk, I meant that I upgraded my D6 system with all contrib modules disabled. And they were still disabled when I dumped the database (with the possible exception of admin_menu).
So should I open another ticket for the menu system on 6.x?
And the most important question is still unanswered: How can I fix this? Is there a way to rebuild the menu from scratch? Wouldn't it be a good idea if the upgrade would fix this on-the-fly?
I took the liberty of reopening this ticket, feel free to close it again but kindly provide some suggestion on how to proceed. Apparently I'm not the only one having issues with corrupted menus.
Comment #15
marcvangendThe sentence "with the possible exception of admin_menu" is important here. The D6 version of Admin Menu does a lot of menu altering so that might be the cause of your problems. If you can show us that this problem is not related to admin_menu, then this is a critical issue for Drupal core. If not, I think this should be moved to the admin_menu project.
If I were you, I would completely disable and uninstall admin_menu in the D6 site and then attempt an upgrade again.
Comment #16
ralphb commentedWell, I had another look at the database. I'll try to recap:
Which is probably fine in hindsight. I guess I was expecting some functionality that would cause Drupal to reparse its modules' menu hooks to rebuild the menu from scratch. And some menu sanity checks probably wouldn't hurt, either.
I'll change the status of this ticket accordingly, hope that suits everybody.
Comment #17
marcvangendI don't agree. Have a look at the admin_menu_menu_alter function (http://drupalcontrib.org/api/function/admin_menu_menu_alter/6). Changing core menu items is its job.
Comment #18
chx commentedThis is impossible to do. You have customized items, how any code is going to know they are unneeded?
Comment #19
ralphb commentedJust for the protocol:
It doesn't. As I said, the idea is to rebuild the menus from scratch. This would throw away all customized menus and menu items. Many users might prefer this approach to fiddling manually with their database in case of corruption.
Comment #20
verta commentedI can certainly live with #19.
Comment #21
bfroehle commented@ralphb: I think #19, the idea to rebuild menus from scratch, would be a good contributed module.
Comment #22
rfayOK, after a conversation with webchick, I'm going to call this major, but we have to have a specifically recreatable, testable path to cause the problem. We would really like this *not* to happen to people, but without a clear, understandable way to test it, it's never going to happen.
Comment #23
geerlingguy commentedI would like to assist in finding a way to test this... I am having one of my upgraded sites exhibit some sort of 'ghost in the system' problems with the entire menu system - menu options don't appear on node edit forms (they did in D6), menu items are being improperly reparented, and the toolbar module keeps losing all the management menu links (thus, it's empty except for the home and account links).
(Looking further into these issues, it looks like I additionally had to select an Available menu for each respective content type to have the menu options appear on that contenty type's edit forms... highly annoying—and a major pain in the rear for larger sites with 10+ content types).
Comment #24
rfayI'm willing to study a failed upgrade. It seems ralphb's #10 is invalid, as it was already messed up before the upgrade.
@geerlingguy, if you have a D6 database that I can use to demonstrate this, I will take a look at it.
However, if nobody has an integral D6 database that can be used to test this upgrade path, it will just end up getting closed again. We have to have real live testable situations.
Comment #25
chx commentedRebuilding menu_links is completely out of question. Sorry, but you have no idea what are you talking of. menu_links have no code equivalent to rebuild from. Now, it is certainly possible after a backup to DELETE FROM menu_links WHERE module = 'system' and then rebuild the menu (which rebuilds the menu router and as a side effect regenerates the system links). However, core can't do that because you might have customized system links as well.
Comment #26
geerlingguy commentedFollowing chx's advice in #25, I simply did a:
Then I rebuilt the menu by visiting www.example.com/devel/menu/reset (I have the Devel module enabled). Lo and behold, all menu troubles have vanished.
I discarded my D6 backup—stupid thing to do, but oh well...—and if I run into this problem again, I'll be sure to post the DB backup here to see where everything went wrong.
Comment #27
ralphb commented@chx: Actually, all I suggested was that the menu_links table be discarded and then all entries be re-read from the core and non-core modules. Of course this will obliterate all custom menus and custom menu entries. If devel module is already doing the second part of this suggestion not only for system but also for other modules then, well, that's great, nothing to see here!
@rfay: Yes, there is no issue with the update itself. This is why I changed title and categorization of this ticket some time ago. I'll close it now, as no other users seem to have any issues.
Comment #28
wOOge commentedJust adding my voice to this conversation — I upgraded from Drupal 6.22 -> Dupal 7.4 and clicked "reset" on all of the menu items that had the link. I then found myself with duplicate menus (just like in the original post).
Most of the custom created menu links I added to the "Navigation" in D6 which linked to content types that no longer existed in D7 (I had deleted them after the upgrade), had "reset" next to them — which when clicked, turned them into generic "Add Content" links (non-deleteable) that pointed to node/add.
#26works.First backing up the DB, then Using phpMyAdmin, and the SQL Query string:
DELETE FROM `menu_links` WHERE `module` = "system"as outlined in#26, then rebuilding with the devel module, seems to have helped me as well.Comment #29
dagleesConfirmed that #26 worked here too after an upgrade from D6 => D7.
Comment #30
twowheeler commentedI can also confirm that #26 worked here after an upgrade from D6 => D7 and much hair-pulling. Thanks!
Comment #31
dadaisme commentedTo add to #28 : "Most of the custom created menu links I added to the "Navigation" in D6 which linked to content types that no longer existed in D7 (I had deleted them after the upgrade), had "reset" next to them — which when clicked, turned them into generic "Add Content" links (non-deleteable) that pointed to node/add."
This happens as well whit links to modules that where disable and uninstalled. Links where reset to there top parent on the menu creating many duplicates.
The menu items where simply not deleted on each unninstall of a module or deletion of a content type in D6. This is a D6 (D7) core bug ?
On my second D6->D7 upgrade, I deleted the duplicates in menu_links before going ->D7. Since I still have minor menu troubles, I will try #26.
Thx.
[Edit: #26 works]
Comment #32
gamgllc commentedNeed help reconstructing menus on web site if available contact gamgllc@earthlink.net
Comment #33
marcvangend@gamgllc Welcome to the Drupal community. The issue queue is where we try to solve problems by discussing and sharing solutions. If you need individual support, try the forum or IRC.
Comment #34
hkirsman commented#26 works like a charm. Hope it is the right way too :)
Comment #35
gfury commentedThank you!
#26
Been banging my head against the wall for hours. Seems to be fixed.
Comment #36
ñull commentedFor me #26 also worked to reset my menus before upgrading to D7. My suggestion is to include the query in devel and it would be nice when it can be run from command line too (with drush?).
Comment #37
uotonyh commentedAnother chime in for solution outlined in #26, but after D6 - D7 upgrade.
This cured a "You do not have any administrative items" message I was receiving when I went to view reports.
Thanks!
Comment #38
jvieille commentedDELETE FROM menu_links WHERE module = 'system'
saved me.
I felt it scary, though
Comment #39
bradallenfisher commentedThis also worked for me. I backed up first though. Cause also was scared of outcome :) After visiting
/devel/menu/reset
everything came back.
Comment #40
MatthijsG commentedThanks, #26 worked for me. Don't forget the table prefix! It even resets the menu-structure with sub-menu items.
mysql> DELETE FROM [table_prefix]menu_links WHERE module = 'system'and then devel/menu/reset (off course with devel module on)
Comment #41
LynnS commentedHere we are all these years later and this is still a problem (it shouldn't be). #26 worked for me in my upgrade from D6 - D7. Didn't even lose my custom links!
Marking for future searchers:
missing toolbar, missing toolbar links, missing admin toolbar
Comment #42
robcarrI ran
DELETE FROM `menu_links` WHERE `menu_name`= 'management';then cleared caches in D7. Cleaned up the admin menu nicely.Comment #43
Collins405 commentedJust ran into the same problem, and geerlingguy #26 fixed it for me.
Thank you!!
Comment #44
hkirsman commented#26 didn't work for me. All links are gone forever. Do backup before this fix :)
Comment #45
MatthijsG commentedRan into this problem recently. A lot of 'add content'-links, no list of Content Types and more. Followed #26. A small note: if you use a prefix, you've to alter the command. Like: DELETE FROM prefix_menu_links etc.
Comment #46
aramboyajyan commentedJust ran into the same issue and want to confirm that #26 worked perfectly.
Since Devel's menu rebuild callback just executes the system
menu_rebuild()function, you can execute the following code manually as well:Gist is here: https://gist.github.com/aramboyajyan/1a8a41d8acd343d3a6b228d258c1875c
Comment #47
markdcBeen wondering for years what was wrong with our admin menus, then I stumbled upon this. We, too, had upgraded from D6. Tried the commands from within Terminal, but they didn't work — mysql> kept hanging. Tried it from phpMyAdmin — "1197 rows affected". Ho! Now I'm nervous, right? Entered the link "devel/menu/reset" as mentioned above, and it actually worked! Amazing!! Thank you!
Comment #48
designcrs commentedExecuting the following SQL query and clearing all caches just fixed the management menu on Drupal 7. And I've tried several other solutions before.
DELETE FROM menu_links WHERE module='system'Edit: Just noticed that this is the same as in #26