Resolved

Resolved in: 3.6.3

Symptoms

This issue occurs when WPML is activated but its setup is not completed.

The error message starts with: PHP Fatal error: Uncaught exception ‘InvalidArgumentException’ with message ‘Argument $language_code must a non empty string.

Workaround

This issue will be fixed in a future release version. However, the problem is quickly resolved by deactivating WPML plugin or completing the setup wizard.

7 Responses to “A fatal error is thrown on front-end when a menu is assigned to a location and WPML setup is not complete”

  1. I get the following:
    Fatal error: Uncaught exception ‘InvalidArgumentException’ with message ‘element_id and type do not match for element_id:517 the database contains post_page while this function was called with post_nav_menu_item’ in /nas/content/staging/translatemx/wp-content/plugins/sitepress-multilingual-cms/classes/core-abstract-classes/class-wpml-set-language.php:28 Stack trace: #0 /nas/content/staging/translatemx/wp-content/plugins/sitepress-multilingual-cms/sitepress.class.php(1639): WPML_Set_Language->set(‘517’, ‘post_nav_menu_i…’, NULL, ‘es’, NULL, true) #1 /nas/content/staging/translatemx/wp-content/plugins/sitepress-multilingual-cms/inc/wp-nav-menus/class-wpml-nav-menu.php(205): SitePress->set_element_language_details(‘517’, ‘post_nav_menu_i…’, NULL, ‘es’) #2 /nas/content/staging/translatemx/wp-content/plugins/sitepress-multilingual-cms/inc/wp-nav-menus/class-wpml-nav-menu.php(78): WPML_Nav_Menu->_set_menus_language() #3 [internal function]: WPML_Nav_Menu->init(”) #4 /nas/content/staging/translatemx/wp-includes/class-wp-hoo in /nas/content/staging/translatemx/wp-content/plugins/sitepress-multilingual-cms/classes/core-abstract-classes/class-wpml-set-language.php on line 28