Skip Navigation

Resolved

Reported for: WPML Media Translation 2.5.6

Resolved in: 2.6.0

Overview of the issue

If you send a page containing various images to be translated and you delete some of the images from the media library, you might have issues translating to the other languages.

Another case that will probably produce the same results is if you have an empty id in the shortcode for image caption – e.g. .

Workaround

wp-content/plugins/wpml-media-translation/classes/media-translation/class-wpml-media-post-images-translation.php
Change:

			$new_caption_shortcode = $this->replace_caption_id_with_translated_id(
				$new_caption_shortcode,
				$attachment_id,
				$language
			);

to

if ($attachment_id !== NULL) {
	$new_caption_shortcode = $this->replace_caption_id_with_translated_id(
		$new_caption_shortcode,
		$attachment_id,
		$language
	);
}