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.
With menu module enabled:
- Reseting a menu item causes it to be duplicated.
- Disabling a menu item causes it to be duplicated.
- Enabling a menu item causes it to be duplicated.
- Editing a menu item causes it to be duplicated.
Also:
- Reset links are shown for all menu items, rather than just those which have been modified.
- The "Logs" section on /admin is now above the "User management" section.
Comment | File | Size | Author |
---|---|---|---|
#11 | Clipboard01.jpg | 20.28 KB | kenorb |
#3 | menu_inc_0.patch | 1.41 KB | chx |
Comments
Comment #1
agentrickardConfirmed.
Comment #2
agentrickardThere seems to be a logic error in
function menu_link_save()
in menu.inc at line 1346. The INSERT statement is run regardless of whether the menu item exists or not.I cannot tell from the code if what part after line 1323 should be included in the
if ($existing_item)
check. Maybe just the INSERT query.Comment #3
chx CreditAttribution: chx commentedErm yes.
Comment #4
agentrickardFixed.
Comment #5
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks.
Comment #6
(not verified) CreditAttribution: commentedComment #7
errement CreditAttribution: errement commentedI have updated to D6.5 and i got the problem again. Saw that you've modified includes/menu.inc to:
What i did; Changed the "Create content" with all the children menus it has from "Navigation" to "Primary links" menu. When i reset it dulicates.
How could i remove these duplicates?
Comment #8
errement CreditAttribution: errement commentedif (!$existing_item) {
db_query("INSERT INTO {menu_links} (
menu_name, plid, link_path,
hidden, external, has_children,
expanded, weight,
module, link_title, options,
customized, updated) VALUES (
'%s', %d, '%s',
%d, %d, %d,
%d, %d,
'%s', '%s', '%s', %d, %d)",
$item['menu_name'], $item['plid'], $item['link_path'],
$item['hidden'], $item['_external'], $item['has_children'],
$item['expanded'], $item['weight'],
$item['module'], $item['link_title'], serialize($item['options']),
$item['customized'], $item['updated']);
$item['mlid'] = db_last_insert_id('menu_links', 'mlid');
}
Comment #9
errement CreditAttribution: errement commentedI had to delete the duplicated menus form database, using phpMyAdmin on my server. I'll never reset again because i know what is gonna happen. But would like to know why is this happening and how to prevent it.
Thank you so much.
Comment #10
yang_yi_cn CreditAttribution: yang_yi_cn commentedComment #11
kenorb CreditAttribution: kenorb commentedThe same problem.
I've got the same duplicated menu items `Create content`, but none of them I can delete or even reset.
Edit doesn't help.
Comment #12
mark.pearson CreditAttribution: mark.pearson commentedI've had the same problem with duplicate menu items in 6.10.
It seems to relate in my case to creating custom content types with CCK and adding menu items via hook_menu in my custom module. I had been trying to change the titles of my menu items in my module code but the actual menu items which appeared kept the old names. I am fairly noob to Drupal so I couldn't figure out how to force a refresh of the menu. I though that deleting the cache might be relevant and couldn't Google a clear answer.
So then I went to '/admin/build/menu' to see if I could delete the unwanted items, having uninstalled my module (bear in mind that I'm a noob so may be missing obvious steps). I couldn't delete the items so I tried clicking on the reset link for each. It's at this point that I ended up with multiple '/admin/content' items. In the end I had to delete them from the 'menu_links' table directly.
Now I'm looking at a site which has 2 'Administer' links in the navigation menu.
I can't figure out what's going on.
Hopefully this information is useful.
Comment #13
hexabinaerSame problem, but no connection to CCK.
I upgraded from an up-to-date Drupal 5 installation, struggled through some mysql warnings and right after the last warning disappeared an I looked at my menu, there was a duplicate Logout link in the menu.
After clicking Administer - whoops - another copycat link. Didn't happen to the node(page)-generated menu items, though. After activating taxonomy menu Gorgo grew new fierce heads: clicking through the configuration options, every new approach produced new links for every disabled item (disabled by "hide empty terms"). Hierarchical experiments left their traces, too: the multiples linger in different levels.
It's not a Drupal 6 issue either. I had duplicate menu items in a D5 installation (somewhere between 5.7 and 5.12).
My setting:
Comment #14
ferenc CreditAttribution: ferenc commentedI had duplicate menus in 6.10 for announcements, contact and blog under create content. All I did is on the modules page I disabled the problem module saved the set up and then reenabled it again. The duplicate menu disappeared.
sometimes you just have to turn things on and off to make it work. I have no clue what may have caused this but it looks like my solution worked.
Comment #15
Scott M. Sanders CreditAttribution: Scott M. Sanders commentedOkay, I have a d5 site that I wanna update to d6, but no matter what I do, I get duplicate navigation menu entries, and from the looks of this URI -- http://drupal.org/node/34639 -- it's been an issue since d4, but anyway as I still have my d5 site intact, what do I need to do to get it to d6 without getting dupe nav menus? TIA.
Comment #16
Scott M. Sanders CreditAttribution: Scott M. Sanders commentedOr how can I just simply delete and then recreate all the available commands in the navigation menu in the d6 installation I have now -- is that possible?
Comment #17
Scott M. Sanders CreditAttribution: Scott M. Sanders commentedToday I tried again with a fresh d6 and my old d5 db and ended up with just a duplicate admin menu and logout link in the navigation menu.
I then edited my new d6 db with phpMyAdmin, found menu_links, sorted by menu_title, and deleted all duplicates for navigation (I have admin_menu also, so I skipped these). I deleted the newer record of each.
My site did not update immediately though until I performed such with /update.php, at which point I was happy to find no duplicates on my return, just some reparenting needed mostly for some config/setting modules, which I could only do after turning the menu (customization) module back on. (I say "needed" because they seem to not work correctly when incorrectly parented, that and it just looks bad anyway.)
I noticed that the admin_menu module for d6 has a handy "Wipe and Rebuild" button. How handy this would be for Drupal core for navigation menus given this apparently undying and needlessly painful issue.
Comment #18
brianV CreditAttribution: brianV commentedComment #19
Jeremy Toaster CreditAttribution: Jeremy Toaster commentedI have the same issue, but only with the "Site Configuration" navigation menu item.
I currently have 22 !!! copies of
Site configuration (disabled)
menu items.I have disabled the modules MENU, DHTML MENU and MENU SERVICES.
I have flushed caches and anything else I could think of. I have tried "reset" on the entire Navigation tree and nothing works. Whenever I install practically ANY new module that places a link into the Navigation Menu, it duplicates the "Site Configuration" link.
I am running 6.12 right now.
jeremy
Comment #20
Jeremy Toaster CreditAttribution: Jeremy Toaster commentedI went into the menu_links in the database and deleted all the extra "Site Configuration" links just now.
So far none have shown back up. Hopefully it will stay that way.
Comment #21
ariflukito CreditAttribution: ariflukito commentedsubscribing
Comment #22
rudeboyintrouble CreditAttribution: rudeboyintrouble commentedMultiple "Create Content" menus in my Nav Menu.
Drupal 6.13
Comment #24
Agogo CreditAttribution: Agogo commentedThis is interesting. Im having a such a simular problem it cant be a coincidence.
The main problem is that Im getting multiple menu items, not just duplicates. It also seems to have something to do with CCK since the multiple menu items I get mostly consists of "Manage fields" and "Display fields" options. Mostly.
Also, the module "Administration menu" seems to be a part of the problem - for me, that is. However, disabling "Administration menu" doesnt solve the problem, it only makes it less ill.
Im using Drupal 6.13 in this case and on many others sites.
I also use both CCK and "Administration menu" on almost every other Drupal 6 site Ive administered and none of these problems exist there. All other modules Ive got installed or active on this site are used on some or several of my other sites. This is the only one where I experience the problem.
Which is wierd from my point of view.
However, In my case and perhaps also for you others the bug seems to lie in Drupal:
http://drupal.org/node/550254
PS. For those having problems with numerous copies of menu items and uses "Administration menu" (1.5), try this MySQL command in phpMyadmin or such to delete all menu items in navigation (Dont worry, theyll get rebuilt after a couple of page loads).
DELETE FROM `menu_links` WHERE `menu_links`.`module` = 'admin_menu'
Comment #25
hermes_costell CreditAttribution: hermes_costell commentedI ended up also having to delete all 'system' menu links as well, and then rebuild the menu. I had most menu items either as triples or higher, and the whole admin system was going berzerk. I'm not yet sure if the issue is resolved yet... but steps I took:
Ran
DELETE FROM `menu_links` WHERE `menu_links`.`module` = 'admin_menu'
Ran
DELETE FROM `menu_links` WHERE `menu_links`.`module` = 'system'
Went to:
admin/build/modules
Which rebuilt the menu, and things now look great. My frequency of db hits were berzerk before this fix, and are now totally calmed down.
Comment #26
itbalance CreditAttribution: itbalance commentedHermes,
Thanks for your advice. Removed items and rebuilt and all is well. I don't want to point any fingers, but it seems that whenever I wipe and rebuild using the administration menu module link, I'm getting duplicate menu items. For now, I just won't do that :)
Comment #27
wOOge CreditAttribution: wOOge commentedI had the same issue — seemed to crop up out of nowhere - comment #25 suggestions worked for me.
Comment #28
gilf CreditAttribution: gilf commentedsubscribing
Comment #29
JirkaRybka CreditAttribution: JirkaRybka commentedI had duplicate links after 5.x->6.x upgrade (growing more afterwards). My fix was to "reset" all links offering that operation pre-upgrade on 5.x, entering the upgrade process with no customizations at all. On 6.x I re-do the few needed modifications, and all is fine. On my site, that is, I don't really know what causes the problem.
Comment #30
Rudolph CreditAttribution: Rudolph commentedTrying to update 5.20 to 6.14 I ended up with triplicate links all over. After truncating menu_links and running update.php it was mostly fixed. Now I've still got three "Primary links" entries in /admin/build/menu, I guess those aren't stored in menu_links? Anyway, punching "delete" for the two extra ones does not seem to remove them.
Comment #31
Rayrunner CreditAttribution: Rayrunner commentedSubscribing
Comment #32
brianV CreditAttribution: brianV commented@Rudolph,
Please don't change the version.
Comment #33
not_skjalf CreditAttribution: not_skjalf commentedsubscribing
Comment #34
AppleBag CreditAttribution: AppleBag commentedI'm having the same problem, but with D5. Tried to execute the DELETE FROM `menu_links` WHERE `menu_links`.`module` = 'admin_menu' code, but there's no menu_links tabel in the D5 db. Anyone have any suggestions?
Comment #35
Jason Brain CreditAttribution: Jason Brain commentedSolution on Post #25 worked great for me just now.
Will continue to test to ensure.
Comment #36
lauggh CreditAttribution: lauggh commentedSubscribing. I'm running D 6.14 using Acquia install
Comment #37
gavranha CreditAttribution: gavranha commentedSame here. Drupal 6.14, admin menu (and devel).
#25 did a good clean-up. Thanks hermes_costell. Clean and smart workaround.
Comment #38
suryaprakash CreditAttribution: suryaprakash commentedBut I found the line numbers are different
Comment #39
Funkymoses CreditAttribution: Funkymoses commentedI also had this issue, though I'm not using the admin menu module. Post 25 also worked for me, but I had to actually click "save" in admin/build/module to get the menu to re-appear.
Comment #40
matt2000 CreditAttribution: matt2000 commentedconfirming that this issue still exists, and is repaired by the steps in #25. (I actually just used admin_menu to flush the menu cache, rather than visiting admin/build/modules. Same thing.)
Comment #41
artscientific CreditAttribution: artscientific commentedJust an FYI we upgrade a lot of sites and this just happened to us going from 5.15 to 6.16. It wasa pretty straight forward site and the only thing that stands out that might be of help is that the site had menu items that linked directly to files rather than to pages or links. Hope that helps track this one down.
Also confirmed that #25 (tyvm!) solved most of the menu problems combined with a cache flush.
Good Luck to all,
-Peter
Drupal theme and web design ArtScientific.com
Comment #42
supersteph CreditAttribution: supersteph commentedi'm not getting the duplication of menu items, but my menu will completely rearrange itself after running an update with drush (not with update.php). this has afflicted both navigation menu and primary links menu. has anyone else had this happen? (sorry if slightly off topic)
is it possible that panels or views or something else that creates menu items could be the culprit?
D6.16
using admin menu, but not devel
Comment #43
nvahalik CreditAttribution: nvahalik commentedAgree with #41. #25 and a cache flush fixed my problems.
Comment #44
kenorb CreditAttribution: kenorb commentedRelated issue: http://drupal.org/node/647064#comment-3024462
Comment #45
pbucalo CreditAttribution: pbucalo commentedsubscribing
Comment #46
euchrid9 CreditAttribution: euchrid9 commentedSame problem on Drupal 6.16. Seems related to custom CCK fields in my case. Had to edit the database manually to resolve it. Flushing cache did not clear menu items for me; also, it does not completely clear old, deleted custom CCK fields - maybe the two are related?
Comment #47
Imagone CreditAttribution: Imagone commentedsubscribing
Comment #48
asb CreditAttribution: asb commentedsub
Comment #49
clashar CreditAttribution: clashar commentedsub
Comment #50
marcdecaluwe CreditAttribution: marcdecaluwe commentedsubscribing
Comment #51
nicknickoli CreditAttribution: nicknickoli commentedsubscribing
Comment #52
s13 CreditAttribution: s13 commentedI was having similar problem after upgrade from 5.x to 6.x. hermes's suggestions worked like a magic for me. Nice job sir. many thanks.
Comment #53
asb CreditAttribution: asb commentedYou mean the SQL from #24 and #25? Doesn't this erase all customizations of the menu, e.g. administrative views and renamed menu items?
Comment #54
s13 CreditAttribution: s13 commented@asb
Only sql from #25. Visit the modules page admin/build/modules (as suggested by hermes) after executing the sql, it will rebuild everything.
Comment #55
asb CreditAttribution: asb commented@s13: Thanks; I tried the statement from #24, but it didn't remove the duplicate menu entries for me.
Comment #56
clashar CreditAttribution: clashar commentedI did #25, but now I have problems with all my menus, including admin menu. Some disappear, some misplaced. I don't know how to restore it.
Comment #57
hermes_costell CreditAttribution: hermes_costell commentedAnd to confirm: you did visit admin/build/modules right after running the SQL query?
Comment #58
clashar CreditAttribution: clashar commentedhermes_costell, yes I did.
Maybe the problem is related to my Menu Editor version that is 6.3.dev.
Comment #59
Alauddin CreditAttribution: Alauddin commented#25 - Thanks...for the fix. worked like a charm. run the 2 commands and flush cache.
Comment #60
dddave CreditAttribution: dddave commented#924056: multiple "create content" menu items that can not be removed. closed as duplicate
Comment #61
rootworkIf you get a WSOD and "Unsupported operand types" error when trying to load the modules page, flush the cache first. That fixed it for me.
Edit: Meaning if you get that after trying the solution in #25. The solution worked for me, but I got the WSOD until I flushed the cache (and then was able to access the module page and save).
Comment #62
brianmercer CreditAttribution: brianmercer commented#25 worked, thanks.
Comment #63
AntiNSA CreditAttribution: AntiNSA commentedthanks!!!
Comment #64
rootworkSo I'm pretty sure we can say this is fixed; it was patched to prevent this on any new Drupal installs (see #5 above) and any continuing problems probably stem from Drupal installs that existed before that, for which there's a solution listed in #25.
If you're arriving on this page and are having this issue, and the fix in #25 does not address it, this can be re-opened. If it seems like a slightly different issue, it's best to open a new issue, and perhaps reference this one if it seems related.
Closing issues from four years ago is fun :)
Comment #65
AntiNSA CreditAttribution: AntiNSA commentedmy install is new on pressflow 6 and it definately isnt fixed. There were tons of problems removed from my database on #25. I am afraid I will have to run that patch periodically. Fixed would mean not needing # 25. # 25 is equivillent to clearing a table.... Imean whats going to happen when the table gets rubbish in it again? Wouldnt fixxed bein g that you would never require @ 25?
Comment #66
asb CreditAttribution: asb commentedI acree, this issue isn't properly fixed as the SQL from #25 is destructive, and it doesn't prevent duplicate menu items from reappearing on Drupal 6.20 after running the SQL statements. I don't think that resetting and rebuilding the menu on a regular basis by running SQL delete operations can be considered "fixed".
Comment #67
Anonymous (not verified) CreditAttribution: Anonymous commentedThis bug is still active. I just closed duplicate thread http://drupal.org/node/344543 and put a note on a support request here http://drupal.org/node/1151474 ... #25 worked for me.
Comment #68
ergonlogicThe original issue included steps to reproduce, which was then confirmed (#1) and fixed (#5).
Unless repeatable steps to reproduce the error are provided, this won't likely get much attention.
Comment #69
ZenLax CreditAttribution: ZenLax commentedAnother confirm that #25 indeed provides a viable workaround to fix the symptoms, if not the root problem. Phew! Thank you hermes_costell
Comment #70
ebrueggeman CreditAttribution: ebrueggeman commentedsubscribing
Comment #71
MarkBGH CreditAttribution: MarkBGH commentedAnother confirmation that #25 does the job. I have very little back end experience and I followed the instructions exactly with great success. Note that before the last step it will look like ALL of your admin menu items have disappeared, but following the steps to completion will bring back things nice and tidy. Thanks again for the fix, this has been driving me nuts for over a year now.
Comment #72
boon4376 CreditAttribution: boon4376 commentedAnother confirmation that #25 works...
It actually worked for me with Drupal 7
going to "admin/build/modules" did not work though, I had to do the following (not sure which of my additional steps are necessary, but it worked)
So again, after running the SQL statements in my Drupal 7 database, I did the following in the Drupal administrative interface:
And everything went back to normal.
Comment #73
sunPatch in #3 was committed in 2007. Reverting status.
All later follow-ups were most probably rather about #550254: Menu links are sometimes not properly re-parented - you may want to follow that issue, but please don't derail it with D6 bug reports as long as it hasn't been fixed for D8, thanks.
Comment #74
rggoode CreditAttribution: rggoode commentedsubscribe
Comment #75
jbd44 CreditAttribution: jbd44 commentedYes, #25 worked, but I had to clear the cache as an additional step.
Comment #76
vaibhav9392 CreditAttribution: vaibhav9392 commentedanother confirmation that #25 works for me...
Comment #77
ann b CreditAttribution: ann b commentedProblem reoccurs in Drupal 7.23.
Steps to reproduce:
1. Deleted all content for a custom content type called Gallery External File.
2. Deleted the Gallery External File content type.
3. Checked the Navigation Menu. The Gallery External File menu item was still there, under the Add Content parent. The Gallery External File menu item was enabled, and the edit and reset menu links were available.
4. Disable the menu item.
5. Reset the menu item. Not ok.
Result: The Gallery External File menu item is removed. But now a second Add Content item appears.
Comment #78
ann b CreditAttribution: ann b commentedI changed the status from Closed to Active. I did not change the version, which is currently set to 7.22. I reproduced the problem in 7.23.
Comment #79
dcam CreditAttribution: dcam commentedThe problem mentioned in #77 is described in the issue summary of #550254: Menu links are sometimes not properly re-parented. Further reports about that issue should go there.