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.

- 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.

#11 Clipboard01.jpg20.28 KBkenorb
#3 menu_inc_0.patch1.41 KBchx
Members fund testing for the Drupal project. Drupal Association Learn more


agentrickard’s picture


agentrickard’s picture

There 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.

chx’s picture

Status: Active » Needs review
1.41 KB

Erm yes.

agentrickard’s picture

Status: Needs review » Reviewed & tested by the community


Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD. Thanks.

Anonymous’s picture

Status: Fixed » Closed (fixed)
errement’s picture

Version: 6.x-dev » 6.5
Status: Closed (fixed) » Active

I 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?

errement’s picture

if (!$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');

errement’s picture

I 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.

yang_yi_cn’s picture

Version: 6.5 » 6.8
kenorb’s picture

Version: 6.8 » 6.9
20.28 KB

The 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.

mark.pearson’s picture

Version: 6.9 » 6.10

I'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.

hexabinaer’s picture

Same 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:

  • Drupal 6.10 German
  • mysql 5.0.45, php 5.2.3
  • Zen custom theme
  • Activated: Aggregator, Blog, Book, Comment, Contact, Database logging, Forum, Help, Locale, Menu, Path, PHP filter, Search, Statictics, Taxonomy, Update status, Upload
  • Installed + activated: CCK, Views, Custom Breadcrumbs, Pathauto, Site map, Theme Settings API, Token, Taxonomy Menu
ferenc’s picture

I 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.

Scott M. Sanders’s picture

Okay, 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.

Scott M. Sanders’s picture

Or 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?

Scott M. Sanders’s picture

Today 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.

brianV’s picture

Version: 6.10 » 6.x-dev
Jeremy Toaster’s picture

I 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 Toaster’s picture

I 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.

ariflukito’s picture


rudeboyintrouble’s picture

Multiple "Create Content" menus in my Nav Menu.
Drupal 6.13

Agogo’s picture

This 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:

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'

hermes_costell’s picture

I 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:

DELETE FROM `menu_links` WHERE `menu_links`.`module` = 'admin_menu'

DELETE FROM `menu_links` WHERE `menu_links`.`module` = 'system'

Went to:

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.

itbalance’s picture

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 :)

wOOge’s picture

I had the same issue — seemed to crop up out of nowhere - comment #25 suggestions worked for me.

gilf’s picture


JirkaRybka’s picture

I 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.

Rudolph’s picture

Version: 6.x-dev » 6.14

Trying 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.

Rayrunner’s picture


brianV’s picture

Version: 6.14 » 6.x-dev


Please don't change the version.

not_skjalf’s picture


AppleBag’s picture

I'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?

Jason Brain’s picture

Solution on Post #25 worked great for me just now.
Will continue to test to ensure.

lauggh’s picture

Subscribing. I'm running D 6.14 using Acquia install

gavranha’s picture

Same here. Drupal 6.14, admin menu (and devel).

#25 did a good clean-up. Thanks hermes_costell. Clean and smart workaround.

suryaprakash’s picture

But I found the line numbers are different

Funkymoses’s picture

I 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.

matt2000’s picture

confirming 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.)

artscientific’s picture

Just 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,
Drupal theme and web design ArtScientific.com

supersteph’s picture

i'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?

using admin menu, but not devel

nvahalik’s picture

Agree with #41. #25 and a cache flush fixed my problems.

kenorb’s picture

pbucalo’s picture


euchrid9’s picture

Same 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?

Imagone’s picture


asb’s picture


clashar’s picture


marcdecaluwe’s picture


nicknickoli’s picture


s13’s picture

I 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.

asb’s picture

You mean the SQL from #24 and #25? Doesn't this erase all customizations of the menu, e.g. administrative views and renamed menu items?

s13’s picture


Only sql from #25. Visit the modules page admin/build/modules (as suggested by hermes) after executing the sql, it will rebuild everything.

asb’s picture

@s13: Thanks; I tried the statement from #24, but it didn't remove the duplicate menu entries for me.

clashar’s picture

I 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.

hermes_costell’s picture

And to confirm: you did visit admin/build/modules right after running the SQL query?

clashar’s picture

hermes_costell, yes I did.
Maybe the problem is related to my Menu Editor version that is 6.3.dev.

Alauddin’s picture

#25 - Thanks...for the fix. worked like a charm. run the 2 commands and flush cache.

dddave’s picture

rootwork’s picture

If 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).

brianmercer’s picture

#25 worked, thanks.

AntiNSA’s picture


rootwork’s picture

Status: Active » Fixed

So 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 :)

AntiNSA’s picture

my 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?

asb’s picture

Status: Fixed » Active

I 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".

Anonymous’s picture

This 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.

ergonlogic’s picture

Priority: Critical » Normal
Status: Active » Postponed (maintainer needs more info)

The 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.

ZenLax’s picture

Another confirm that #25 indeed provides a viable workaround to fix the symptoms, if not the root problem. Phew! Thank you hermes_costell

ebrueggeman’s picture


MarkBGH’s picture

Another 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.

boon4376’s picture

Another 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:

  1. Run Updates
  2. Run Cron
  3. Flush All Caches

And everything went back to normal.

sun’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

Patch 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.

rggoode’s picture


24ma13wg’s picture

Yes, #25 worked, but I had to clear the cache as an additional step.

vaibhav9392’s picture

Version: 6.x-dev » 7.22

another confirmation that #25 works for me...

ann b’s picture

Issue summary: View changes

Problem 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.

ann b’s picture

Status: Closed (fixed) » Active

I 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.

dcam’s picture

Status: Active » Closed (fixed)

The 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.