Skip Navigation

Resolved

Reported for: WPML Multilingual CMS 4.6.9

Topic Tags: Compatibility

Overview of the issue

Translating pages created with the Cornerstone editor via the native WordPress editor, may lead to an issue where the translated content is replaced by the original language content upon saving.

Workaround

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

  • Open …/wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Shared/st/compatibility/class-wpml-page-builders-update.php file.
  • Look for line 27.
  • Replace:
    	public function save( $post_id, $original_post_id, $converted_data ) {
    		$this->save_data( $post_id, $this->data_settings->get_fields_to_save(), $this->data_settings->prepare_data_for_saving( $converted_data ) );
    		$this->copy_meta_fields( $post_id, $original_post_id, $this->data_settings->get_fields_to_copy() );
    	}
    
  • With:
    	public function save( $post_id, $original_post_id, $converted_data ) {
    		$this->save_data( $post_id, $this->data_settings->get_fields_to_save(), $this->data_settings->prepare_data_for_saving( $converted_data ) );
    		if (WPML_PB_Last_Translation_Edit_Mode::is_native_editor( $post_id )) {
    			$this->copy_meta_fields( $post_id, $original_post_id, array( '_cornerstone_settings', '_cornerstone_version' ) );
    		} else {
    			$this->copy_meta_fields( $post_id, $original_post_id, $this->data_settings->get_fields_to_copy() );
    		}
    	}