Hi.
I have some problems with menu and i18n module. I read the module documentation, but I haven't found the answers I was looking for.
1) It seems that with i18n installed and activated, if I create a new content (e.g. a page) and create a contextual menu item (i.e. I create a menu item from the "Menu settings" section at the bottom of the page), the menu item isn't displayed at all, nor in the menu itself, nor in "Administer -> Site Building -> Menus" page. My only chance is to edit the page I created, open again the "Menu settings" section and click on "You may also edit the advanced settings for this menu item", then click on "Submit" on the next page. In this way the menu item is shown.
Is this behaviour correct? Or is it a bug?
2) And, by the way, is there a way to create a unique menu item that point to right content depending on language? I mean, is there a way to create a single menu with items that points to english version of pages, but if my language is italian all the items point to corresponding node translations? I'd like to avoid creating 2 identical menu, one for english and one for italian. I'd like to have one menu only used in both language.
Any help will be appreciated.
Tiziano
Comments
Comment #1
pixel13 commentedNo one can help me?
Comment #2
pixel13 commentedComment #3
liawagner commentedI can confirm this behavior on Drupal 5.1 and would certainly consider it to be a bug. Before installing i18n everything works as expected in regards to menu creation. After installing i18n menus are not created any more when adding new content.
The described workaround works fine:
Comment #4
SpatnyNick commentedI have exactly the same problem. D5.1, i18n 5.x-2.0; I am switching back to the older i18n version...
Comment #5
jose reyero commentedI think I have fixed the menu issues in latest drupal-5. Please, try
Comment #6
(not verified) commentedComment #7
pixel13 commentedHi. Sorry for the big delay, but I've been very very busy.
I tried version 5.x-2.1 of i18n module, but the problem is still there.
I looked into the code and I found that this behaviour is due to the value of 'type' field assigned to menu item. I don't know well how menu system works, but, creating some menu items from 'Menu settings', I noticed that:
- without i18n: the 'type' field equals to 0x76 (decimal 118) and menu item is displayed
- with i18n: the 'type' field equals to 0x56 (decimal 86) and menu item is not displayed
The difference between the two values is 0x20 (decimal 32) that corresponds with flag MENU_MODIFIED_BY_ADMIN.
I also noticed that when a new menu item is created from menu.module, the following instruction is executed (in menu_edit_item_save function):
So, I tried to add a similar instruction in i18n.module (in i18n_nodeapi) like this:
Now menu item creation seems to work well, but I don't have time to test it (and I don't know if it's right, since, as I told, I don't know menu system very much).
Tell me what do you think about it.
Thank you.
Tiziano
Comment #8
kasparsd commentedThank you, Tiziano, for the suggestion. It really solves the problem!
I am wondering if the particular type value has something to do with user permissions.
Comment #9
jose reyero commentedFixed, thanks
Comment #10
(not verified) commentedComment #11
Henrik Opel commentedIt might be helpfull to note that the fix is *not* available in the 5.x-2.1 version, only in the development branch.
Comment #12
dorion commentedI found an another promplem. When I modify a menu under /node/edit/* the menu did not change.
In that function there is a bug. The $item['mid'] and the $node->language variables are inverted in menu update query.
This is the correct order.
Comment #13
jose reyero commentedJust two notes:
- Of course the fix is not in 5.x-2.1 version, it is in the dev branch, which will soon be 5.x-2.2. That's why we have tagged versions for.
- Abt latest comment, please if you find another problem, open another issue.
Comment #14
LeisureLarry commentedReally thank you for the fixes in this thread. Now I only have one problem left with i18n and menus. Is it possible that a missing MENU_MODIFIED_BY_ADMIN is also causing the problem I´ve described in another issue?
http://drupal.org/node/187785
Greats from Germany
LeisureLarry
Comment #15
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.