Skip Navigation

Resolved

Resolved in: 2.6.4

Overview of the issue

When trying to add a post that contains images to the translation basket, you might encounter a fatal error like this one:

PHP Fatal error: Uncaught InvalidArgumentException: Argument ID must be numeric and greater than 0. in /wp-content/plugins/sitepress-multilingual-cms/classes/translations/class-wpml-translation-element.php:29

Workaround

Please make sure you have a working backup of your website before you add that temporary fix:

Go to: wp-content/plugins/wpml-media-translation/classes/media-translation/class-wpml-media-post-with-media-files.php
There, just before the line:

		return apply_filters( 'wpml_ids_of_media_used_in_post', $media_ids, $this->post_id );

add this line:

		$media_ids = \WPML\FP\Fns::filter( 'get_post', $media_ids );

5 Responses to “Fatal error while trying to add a post that contains images to the translation basket”

  1. The same trouble here, but adding this line didn’t work…

    PHP message: PHP Fatal error: Uncaught InvalidArgumentException: Argument ID must be numeric and greater than 0.
    in /wp-content/plugins/sitepress-multilingual-cms/classes/translations/class-wpml-translation-element.php:29