I have upgraded from a German D5 with locale module to D6. I run update.php and everything proceed without errors. After this i logged in and found duplicated menu items in my "navigation" menu.

The duplicated menu items are:
logs
settings
users

What makes me wonder is - the German links are "translated" and the newly (?) created ones are English. Both have the same target URL.

I used $update_free_access = TRUE; for the upgrade.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hass’s picture

Priority: Normal » Critical

Rreproduceable: always

JirkaRybka’s picture

I have duplicate "Administer". (Czech localized site, played with menu items weights previously.) Yes, I know the new one is capitalized, but still it's not very nice behavior.

hass’s picture

"Administer" is not duplicated on my box. I think i have never used weight's in admin section...

chx’s picture

Status: Active » Closed (won't fix)

The menu update checks for duplicates. It might be that in some locale the two entries happen to render the same but compare menu_links table, they will differ.

hass’s picture

Status: Closed (won't fix) » Active

Sorry - but do you think this is my or our fault if Drupal system links are duplicated? I cannot edit/delete this duplicated links in menu configuration... so i think there is something internally broken. And i'm not the only person with this problems, we cannot really fix ourself. I think this is a heavy show stopper!

JirkaRybka’s picture

I examined what I can do through the UI:

- Previously, on 5.x, I "just" wanted my menu to have a logical order, so changed some weights. "administer" moved to the bottom.
- After 5.x->6.x upgrade, there is another "Administer" item. Both pointing to the same path (which I can't edit anyway).
- Observing the administrative UI (menu items id as seen in the operations links), I realized that I have not only "Administer" duplicated - I've the *whole* tree under "Administer" duplicated! (i.e. the items that survived the upgrade - 19 items)
- The only thing I can do is "reset" the old item (which only just moves it to where the new one is), or customize any (pointless), or disable (probably the only way to get rid of double display, but still my administrative menu UI is spammed with duplicate entries).

I examined menu_links table (after the additional link reset and disable), and both the links are identical, excepting 'mlid', 'p1', 'hidden', 'updated' and 'customized' fields.

webernet’s picture

The menu update needs to be changed do the following:

for each (D5 item) {
  if (menu item at that path already exists) {
    move to D5 path
  }
  else {
    create new item
  }
}

Basically, if you've customized any system menu items in D5, you'll currently get duplicates in D6.

chx’s picture

Status: Active » Needs review
FileSize
986 bytes
chx’s picture

FileSize
1.82 KB

Simplified code with comments. The patch is bigger because we removed stuff.

hass’s picture

Status: Needs review » Needs work

This patch does not solve the problems. It makes things more worse...

Now i have a "admin/logs", but there is nothing inside and i get a "page not found2 if i click on it. Not sure, but as i remember this url should only be renamed to "admin/reports" - isn't it? All other prior duplicated links except the "log" link do not exist now.

Additional to the above - ALL my menu links are now flat. The complete menu structure is lost... :-(

hass’s picture

if i klick on admin/build/menu-customize/primary-links or admin/build/menu-customize/secondary-links i get "There are no menu items yet.", but items are displayed... all my other custom links in admin/build/menu-customize/navigation are not visible in the administration area, too. The menu themself list all items (flat mode), but i cannot edit them at all.

Much more worse, for sure.

pwolanin’s picture

I just saw this with a 5.x->6.x update of a clean 5.x install with no translations or customizations - the "Create content" link was duplicated in an odd way.

owahab’s picture

Reproducible on a D5 system:
1. with no change in weights.
2. with English local.
And the duplicates are:
Administer, Administer -> logs, Administer -> settings, Administer -> users.

chx’s picture

Status: Needs work » Needs review
FileSize
2.48 KB

Drupal 5 immediately copies everything to menu table once you visit menu page, I just checked this. This means it is not possible that a child is in the menu table but it's parent is not. This means there is no need for menu links to be filled in beforehand by menu_rebuild. And as router paths are set to empty string anyways, there is no need for the router table to be filled in. We had a rebuild call just before the menu update finishes anyways, we now make sure it happens even if menu module is disabled. So the code can be simplified (and sped up which does not really matter on update but why not).

catch’s picture

I just tried to test this, but was unable to reproduce the duplicated items in an unpatched install. So I'm bumping this for people who've experienced the issue to review it on their setups :)

hass’s picture

Status: Needs review » Needs work
FileSize
11.42 KB

This patch is better then the one before (Menu tree structure not destroyed and i'm able to edit the menu links), but many more links get duplicated then before... now - others than without any of the above patches.

A screenshot is attached... that's too much to write them all down.

hass’s picture

Found more bugs... it looks like that menu items of modules i have installed VERY long time ago and uninstalled - now reapear. But the modules are no more installed and not available as D6...

webernet’s picture

Tested #14 --
-Still getting a duplicate of 'Contact form' in navigation (was moved to primary links under 5.x)

Also -- Both patched and unpatched -- on update only --
-Getting invalid 'url aliases' and 'contact form' links (under 'administer') pointing to /admin/path and /admin/contact (the correct links are also created under 'site building' and point to /admin/build/path and /admin/build/contact)
-Links to forum, aggregator, search appear -- none of these modules were enabled under 5.x, and still aren't.

chx’s picture

time to attach / mail me menu table dumps.

chx’s picture

Status: Needs work » Needs review

After receiving webernet's table and switching off aggregator and forum I do not see anything that should not be there. Do you? There is no duplicate of any contact link:

mysql> select menu_name,hidden,link_path,link_title from menu_links where link_title like '%contact%' order by link_path;
+---------------+--------+------------------------------+-----------------------+
| menu_name     | hidden | link_path                    | link_title            |
+---------------+--------+------------------------------+-----------------------+
| navigation    |      0 | admin/build/contact          | Contact form          |
| navigation    |     -1 | admin/build/contact/delete/% | Delete contact        |
| navigation    |     -1 | admin/build/contact/edit/%   | Edit contact category |
| navigation    |      0 | admin/contact                | contact form          |
| navigation    |     -1 | admin/help/contact           | contact               |
| primary-links |      1 | contact                      | Contact Form          |
| primary-links |      0 | node/2                       | Contact Us            |
+---------------+--------+------------------------------+-----------------------+

The admin/contact link you see comes from Drupal 4.7, delete by hand, there is no way Drupal 6 can know this is a bogus link. If I'd delete all the links which are without a router path, then when you switch back your contributed modules (which you surely switch off as per update instructions) then all the links to contributed paths would be gone. You surely do not want that. This goes to hass, too.

Lacking anything that I could work on, I set back to CNR.

As a followup we can create a contrib module or a button somewhere which deletes internal links without a router_path. This can only occur on update, menu_link_save bails out normally if router_path is not found.

hass’s picture

Status: Needs review » Needs work

I don't have "aggregator" or "forum" used in past, nor activated at any time. If there is no better patch - this needs work! I'm able to send you my menu table via private mail... later the day if this helps with analysis.

Let me say - the problems with the latest patch are only inside "admin". I think Drupal should know best what to do with this links.

JirkaRybka’s picture

I'm not currently sitting at my LAMP testing computer, but I've attached my 5.x (pre-upgrade) menu table to another issue: http://drupal.org/files/issues/menu-table.sql_.txt

I didn't test the patch here yet, though; just providing another testing data, if useful. Unpatched 6.x-dev gives me duplicate link for 'admin' (old one staying, along with some of the descendants inside, plus new one added). Going to test with patch this evening.

chx’s picture

Status: Needs work » Needs review

I am feeling this patch is RTBC and we have a misunderstanding of what the menu upgrade can and can not do. Let me say this again: bogus links can not be identified at core upgrade time because there is no way to discern between "contrib disabled months ago" and "contrib disabled for upgrade". If you have a link which belongs to a core module and is duplicated or is not place where it should then set it back to CNW. If all you have is "wow this link was not here in D5 because I disabled / upgraded my modules/core" then please set to RTBC because that's not something we can solve. Yes, manual cleanup of the user menu will be required. Small price to pay, I say.

hass, please send your table to chx1975 at google's mail service.

webernet’s picture

Status: Needs review » Reviewed & tested by the community

Re-tested #14, and this time I'm not seeing the duplicate items I was getting without the patch.

The other issues I pointed out are a separate issue --> http://drupal.org/node/196043

This patch is RTBC.

hass’s picture

Status: Reviewed & tested by the community » Needs work

I don't like to fight with the status here and i HAVE testet #14 patch and my site gets BROKEN. So please give me a few hours (~2-3h from now) to upload an export of my menu tree here for testing. Remember - this patch is not working for me and my menu tree is garbaged and many many items duplicated - why ever - and i'm not the menu tree developer...

JirkaRybka’s picture

I tested upgrade on both 6.x-dev and 6.x-dev + patch #14. While HEAD still reproduces my problem, the patch was successful - no more duplicates, my menu looks as expected. So patch #14 works fine for me.

Giving time to #25 feedback now, but otherwise this is RTBC for me. Note that I didn't really read and understand the code, I just observed that it works for me.

hass’s picture

@chx: i send you the table by PM.

chx’s picture

Status: Needs work » Reviewed & tested by the community

Hass:

mysql> select path from menu where type=118 group by path having count(mid) > 1 and sum(pid)=3;
+-----------------+
| path            |
+-----------------+
| node/11         |
| node/15         |
| node/17         |
| node/18         |
| node/7          |
| taxonomy/term/4 |
+-----------------+
6 rows in set (0.00 sec)

This is from the menu table dump you sent me. You have your primary links (pid=2) repeated in Navigation (pid=1) in your Drupal 5 database with the same type and the same path. If there is any way the menu upgrade code could know these are bogus it escapes me.

Both JirkaRybka and webernet said we are fine. Your DB dump does not counter this. Expect a little manual work after upgrade.

hass’s picture

Status: Reviewed & tested by the community » Needs work

@chx: my primary links are *not* duplicated. Duplicated links are all links inside "admin" path. This have nothing to do with my custom menus - that should nevertheless do not break anything if this upgrade works like a charm. I don't understand from the above comments, why it is required to turn of core modules (forum, aggregator) to get no links duplicated. There is nothing in docs telling me i must turn off all modules for an upgrade except a small list (whatever modules should be in this list).

I'm sure i'm not stupid and i cannot upgrade to D6 with this buggy upgrade. Have you tried and upgrade with my menu table? What happen and why are core menu links duplicated and why comes some hidden module paths back - from modules i'm no more using over one year and where i do not have this modules installed in D6?

Aside with the same menu structure i've done an upgrade from 4.7 to 5.0 - no troubles at all. This should be possible with drupal's core paths in D6, too. My navigation links and partly doubled primary links are no issues at all about this case and i have not seen any issues with this patch #14 regarding my custom links. It doesn't matter here if i have them doubled to workaround some odd menu issues or not.

hass’s picture

I've checked my outdated old D47 installation about the menu point names... maybe you are correct that there is nothing "duplicated" any more, and we have a different problem here that let totally outdated menu links from 4.7 reappear in D6 that have been invisible in D5 at all!? I have no idea.

This is what could be the cause of my problems... hm... i opened this case - so i could say - all discussions above are OT here and we must change the title here to something appropriate like "Drupal 4.7.x links reappear after Drupal 6 upgrade"... or i need to open a new case about this issue if you think it is different. However you have my menu table any you could take a look, why this D 4.7.x links problem occur.

hass’s picture

Someone able to provide / explain how the value menu_links.hidden is calculated? I cannot find anything about this in D5 - so i have no idea how D5 knows to make "admin/block" (D4.7.x link) hidden and show "admin/build/block" only...

hass’s picture

Status: Needs work » Reviewed & tested by the community

Ok, i'm now moving to the problem i found and that webernet found in http://drupal.org/node/196043, too. Makes most sense after this case has been hijacked for a different bug... i cannot say this patch is RTBC, but i'm setting back as before.

pwolanin’s picture

@haas: menu_links.hidden is new for D6: -1 is a callback (hidden and can never show), 0 is a normal link, 1 is hidden (disabled) but could be re-enabled.

Gábor Hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

OK, committed this one, continue at http://drupal.org/node/196043 with other issues.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.