- Status
- Resolved
- Reported for
- WPML Multilingual CMS 3.1.9.5
- Resolved in
- 3.1.9.7
Overview of the issue
- Go to the menu and create one in the default language.
- Try to create the menu in the second language.
- After saving you will get a 404 error.
Workaround
This problem has been solved in WPML 3.1.9.7
You should update to the recent WPML version to fix the problem
If you don’t want or can’t update WPML, please follow these directions:
- Download the updated version of iclNavMenu.class.php
- Use it as a replacement of
sitepress-multilingual-cms/inc/wp-nav-menus/iclNavMenu.class.php:
Most likely this means you should use your FTP client and upload the file insitepress-multilingual-cms/inc/wp-nav-menus: if you’re asked to overwrite the existing file, just do it.
In case of problems
In case you get any of these issues:
Fatal error: Call to undefined method SitePress::get_setting() in /wp-content/plugins/sitepress-multilingual-cms/inc/wp-nav-menus/iclNavMenu.class.php on line 121PHP Fatal error: Call to undefined function wpml_prepare_in() in /wp-content/plugins/sitepress-multilingual-cms/inc/wp-nav-menus/iclNavMenu.class.php on line 548- A white/blank page
Take these steps:
- Go to “WPML” -> “Support”
- Click on ”debug information“: you will see a gray text box, with a lot of information (it’s a json object)
- Copy the content of the textbox in a text file and name that file as you wish: better if you use the “json” extension, but this is not mandatory
- Create a new WordPress user with admin rights for me to debug the issue
- Install the free “Duplicator” plugin (here).
You can use a different plugin, if you like, but the following directions are specific to Duplicator (though they can be easily adjusted for other plugins) - Create a new package:
- Go to “Duplicator” -> “Packages”
- Click on “Create New”
- Proceed with the wizard, leaving all the default settings (if you wish, you can exclude some files you think are not needed, or that would make the package too big, like the files in “uploads” folder)
- Once the snapshot is ready, download both “installer” and the “package” files
- Create a folder and include the files at step 3 and 6.4 (that is, the text file with the debug information, the installer and the package).
- Zip that folder and upload it on Google Drive, Dropbox or a similar service (or upload the whole folder without zipping, and share it)
- Go to our support forum, and create a support ticket with the following title “Workaround issues - Saving menus in non default language leads to 404 error”: we will ask you to privately share the files you stored at step #8.
If you are using a too old version of WPML, this workaround may not work.
In these cases, you may get a white page, or this errors: PHP Fatal error: Call to undefined function wpml_prepare_in()
To fix this specific error, please follow these steps:
open'wp-content/plugins/sitepress-multilingual-cms/inc/functions.php'
and search forwpml_prepare_in
- If you can’t find it, add this at the bottom of the file:
function wpml_prepare_in( $items, $format = '%s' ) { global $wpdb; $items = (array) $items; $how_many = count( $items ); if ( $how_many > 0 ) { $placeholders = array_fill( 0, $how_many, $format ); $prepared_format = implode( ",", $placeholders ); $prepared_in = $wpdb->prepare( $prepared_format, $items ); } else { $prepared_in = ""; } return $prepared_in; }