Skip Navigation

Resolved

Reported for: WPML Multilingual CMS 3.2.2

Resolved in: 3.2.3

Overview of the issue

Trying to set “This is a translation of” of a post to “-None-” results in it not being saved. It’s only possible to change it to another post.

Workaround

Please follow these steps:

  1. Locate the “save_post_actions” function in the “inc/post-translation/wpml-admin-post-actions.class.php” file.
  2. Find the following code block:
    $trid = isset( $trid ) && $trid ? $trid : $this->get_save_post_trid ( $post_id, $post->post_status );
    // after getting the right trid set the source language from it by referring to the root translation
    // of this trid, in case no proper source language has been set yet
    $source_language = isset( $source_language ) ? $source_language : $this->get_save_post_source_lang ( $trid, $language_code, $default_language );
    
  3. Replace it with this:
    if ( isset( $post_vars[ 'icl_translation_of' ] ) && $post_vars[ 'icl_translation_of' ] == 'none' ) {
    	$trid = null;
    	$source_language = $language_code;
    } else {
    	$trid = isset( $trid ) && $trid ? $trid : $this->get_save_post_trid ( $post_id, $post->post_status );
    	// after getting the right trid set the source language from it by referring to the root translation
    	// of this trid, in case no proper source language has been set yet
    	$source_language = isset( $source_language ) ? $source_language : $this->get_save_post_source_lang ( $trid, $language_code, $default_language );
    }
    

The issue has been resolved in the upcoming new version.