WPML

Overview of the Issue

If you are using WPML 4.6.7 and you attempt to disconnect a translation from its original post, when you select None in the This is a translation of dropdown in the WordPress Editor, the disconnection does not persist. Instead, WPML automatically reverts the changes, re-linking the translation to the original post once you update the translation.

Workaround

This issue is fixed in WPML 4.6.8. Updating solves it on your site, so you only need this workaround if you can’t update yet.

Please, make sure of having a full backup of your site before proceeding.

  • Open …/wp-content/plugins/sitepress-multilingual-cms/classes/core-abstract-classes/class-wpml-set-language.php file.
  • Look for line 169.
  • Change:
    private function change_translation_of( $trid, $el_id, $el_type, $language_code, $src_language_code ) {
    	$src_language_code = empty( $src_language_code )
    		? $this->sitepress->get_source_language_by_trid( $trid ) : $src_language_code;
    	if ( $src_language_code !== $language_code ) {
    		$this->wpdb->update(
  • For:
    private function change_translation_of( $trid, $el_id, $el_type, $language_code, $src_language_code ) {
    	$src_language_code = empty( $src_language_code ) && !is_null($src_language_code)
    		? $this->sitepress->get_source_language_by_trid( $trid ) : $src_language_code;
    	if ( $src_language_code !== $language_code ) {
    		if ($src_language_code == NULL) {
    			$trid = $this->wpdb->get_var("SELECT MAX(trid) FROM " . $this->wpdb->prefix . "icl_translations") + 1;
    		}
    		$this->wpdb->update(

All known issues

Still Seeing This Issue?

If updating doesn’t fix it, ask a support question and we’ll look into it with you.