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 );
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
Hello there,
Thank you for reporting this situation. Could you please open a ticket in our support forum so we can identify if it is variation of the original issue?
https://wpml.org/forums/forum/english-support/
Thank you for your help!
Already did it, thanks~
The workaround worked for us.
Thanks for the fast (quick-)fix.
Looking forward to a permanent bugfix.
Hey there,
We are glad it worked. We hope to release soon a new version including this fix. 🙂