wpml menu 404 – error saat saving menus dalam bahasa lain.

Di sharing tutorial ini saya hanya akan memtranslate solusi dari permasalahan yang saya alami yaitu saat saving menus dalam bahasa lain terjadi Error 404 / keluar pesan halaman tidak ada.

Symptoms

  1. Pergi ke menu dan membuat satu dalam bahasa default
  2. Cobalah untuk membuat menu dalam bahasa kedua
  3. Setelah menyimpan Anda akan mendapatkan error 404 .

Issue ini terjadi pada WPML dibawah versi 3.1.9.7

Cara mengatasi.

  1. Download versi terbaru dari iclNavMenu.class.php pada link
  2. Gunakan untuk menggantikan kelas pada plugin sesuai arahan link sitepress-multilingual-cms/inc/wp-nav-menus/iclNavMenu.class.php:
    Gunakan FTP untuk menghapus file yang lama di folder wp-content/plugin/sitepress-multilingual-cms/inc/wp-nav-menus: hapus yang lama.

Pada pengalaman saya isu ini bisa saya atasi sesuai petunjuk diatas.

Jika terjadi isu lebih lanjut. Ikuti petunjuk berikut (dalam bahasa Inggris) :

Take these steps:

  1. Go to “WPML” -> “Support”
  2. Click on “debug information“: you will see a gray text box, with a lot of information (it’s a json object)
  3. 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
  4. Create a new WordPress user with admin rights for me to debug the issue
  5. 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)
  6. Create a new package:
    1. Go to “Duplicator” -> “Packages”
    2. Click on “Create New”
    3. 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)
    4. Once the snapshot is ready, download both “installer” and the “package” files
  7. 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).
  8. Zip that folder and upload it on Google Drive, Dropbox or a similar service (or upload the whole folder without zipping, and share it)
  9. 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:

  1. open
    'wp-content/plugins/sitepress-multilingual-cms/inc/functions.php'

    and search for

    wpml_prepare_in
  2. 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;
    }

Full description

A 404 error page is shown when saving posts in non default language.

sumber : https://wpml.org/errata/saving-menus-in-non-default-language-leads-to-404-error/

t