Steps to reproduce:
1. Install site with two languages (en-ru).
2. Create a node in En (node/1, for example), translate it to Ru (node/2). Set "about" as an url alias for both versions (you'll get "en/about" and "ru/about" on site).
3. Go Administer - Site building - Menus. Create custom menu.
4. Add first menu item with EN language, set "about" as a path (obviously, you can't set "en/about").
5. Add second menu item with RU language, set "about" as a path (same).
Expected result:
First menu item is linked to English version (node/1), second to Russian version (node/2).
Actual result:
Both menu items linked to the same node (node/1).
Explanation:
The standard validation function menu_edit_item_validate() tries to transforms menu item's path (which can be either url alias or just normal path) to normal path with simple drupal_get_normal_path($item['link_path']) call. It doesn't pass the second language parameter, which should be done to get the proper path in multilingual site. The solution is to pass custom validator before standard and properly transform the path.
P.S. I killed 4 hours to trace this bug.
Comment | File | Size | Author |
---|---|---|---|
i18nmenu-check-normal-path.patch | 1.42 KB | neochief |
Comments
Comment #1
Jose Reyero CreditAttribution: Jose Reyero commentedLooks good, go ahead.
Comment #2
neochief CreditAttribution: neochief commentedCommited, thanks.