Note that this is not about i18menu ; this is about the way i18n removes menu items in all menus.

i18n removes menu items that point to pages in a language that is different than the current content's language. This is true regardless of the multilingual 'content selection mode' setting

I have looked at the problem, and while I can't provide a fix, here are some pointers :

1. In menu.inc, menu_tree_check_access does an SQL query on the nodes pointed to by a given menu item.
2. i18n_rewrite_db_sql is then called ; it ignores the content selection mode setting because
i18n_init overrides it when viewing nodes
3. Thus the SQL is rewritten that excludes nodes not in the current language. The query returns nothing,
menu_tree_check_access removes the menu entry.

My impression is that this is a bug ; though at the very least it should be optional.

Comments

Alice Heaton’s picture

Until this is fixed, I've added a setting to the preserve_language module to revert i18n's behaviour (of changing the content selection mode in hook_init). This deals with this issue (though be careful, it may have unexpected side effects.... I don't understand all the i18n code - presumably, it does this for a reason)

You can get preserve_language here : http://drupal.org/project/preserve_language (just did the change, check it out from HEAD or wait till the next nightly snapshot is there)

jose reyero’s picture

Status: Active » Closed (works as designed)

This is the intended behavior when using i18n (basically, that's what content selection is about...)

Alice Heaton’s picture

Title: Menu items pointing to nodes in different language than content don't appear » "content selection mode" setting is ignored
Status: Closed (works as designed) » Active

basically, that's what content selection is about...

I think you misunderstood me (or I might not have expressed myself clearly).

The problem is that the "content selection mode" setting is ignored.

If I go to admin/settings/i18n and set "content selection mode" to "All content No language conditions apply" then it will still remove menu items that point to pages in a different language than the current node. In effect, it is not possible to switch "content selection mode" off.

The title of the issue might have been misleading - the problem with the menus is the symptom (which is what I was describing according to good practice bug reporting) ; but the cause is the fact the setting is ignored. I am renaming the issue, and moving it back to active. If you still think this is by design, then please let me know and I promise I won't re-open the issue a second time !

Thanks and sorry if my original bug report was unclear.

jose reyero’s picture

Yes, I think you're right.

Fixed it for the case when content selection is switched off, I'm afraid this won't address the whole issue though, so this is still open.

Alice Heaton’s picture

Thanks !

I can confirm the original problem I reported is fixed (ie. my particular set of symptoms) but leaving this open as requested by Jose in #4.

willeaton’s picture

Version: 6.x-1.x-dev » 6.x-1.0-beta4

When I create a menu item from a "create content" page, that link only appears in the designated language - the desired effect.
When I go into the menu section in the admin and create a link manually (say to add a link in the secondary nav for the forums page) and create 4 different menu items for 4 different languages, for each I select the relevant language (forums = english, foros=spanish) but then when i look at the front end, all of the 4 links appear in the top nav regardless of what language I am in.

Cheers
Will

catch’s picture

Status: Active » Postponed (maintainer needs more info)

#6 looks like a different issue to me, since it's not clear if there's any remaining bugs to work out, marking this to active (needs more info).

jose reyero’s picture

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

Closing old issues with no follow up