WPML
Status
Resolved
Reported for
WPML Multilingual CMS 4.6.7
Resolved in
WPML 4.6.8
Topic tags
Bug

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

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 →