Reported for: WPML Multilingual CMS 3.6.1
Resolved in: 3.6.1
Sometimes, not all menus that exist in your site will be listed in the dialog to add a language switcher to a menu. Additionally, the language switcher is missing in the menu of secondary language.
This issue occurs with old installs where the term_id is not always equal to the term_taxonomy_id.
The problem will be fixed in a future release. Meanwhile, it is possible to manually patch the currently released version.
Edit the file wp-content/plugins/sitepress-multilingual-cms/classes/language-switcher/class-wpml-ls-settings.php on the line 267 and replace:
$menu_details = $this->sitepress->get_element_language_details( $menu->term_id, 'tax_nav_menu' );
$menu_details = $this->sitepress->get_element_language_details( $menu->term_taxonomy_id, 'tax_nav_menu' );
Edit the file wp-content/plugins/sitepress-multilingual-cms/classes/translations/class-wpml-menu-element.php on line 27 and replace:
return new WPML_Menu_Element( $element_data->element_id, $this->sitepress, $this->wpml_cache );
return new WPML_Menu_Element( $element_data->term_id, $this->sitepress, $this->wpml_cache );