This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 1 reply, has 2 voices.

Last updated by Dennis 11 months, 2 weeks ago.

Assigned support staff: Dennis.

Author Posts
June 21, 2019 at 3:09 pm #4067981


We have been speaking to one of you reps about some translation services issues we have with a different client we have (, but for this issue as it isn't related to the Translation Services, Ahmed has asked us to post in here.....

We are having issues with the WPML Media plugin throwing fatal php error when we try to save a post.

- It is happening on the Live site
- php v7.2
- It is v2.5.2 of the plugin
- WordPress v5.2
- It happens when we try to save any post or page, even if content hasn't been changed in any way.
- If content has been changed, that content does get saved, so the error is happening after the post has been updated
- We have tried to deactivate the plugin and reactivate and it hasn't changed
- We have had to leave the plugin deactivated at the moment so the client can still update content.

[Tue Jun 11 13:49:10.494867 2019] [php7:error] [pid 23457] [client] PHP Fatal error: Uncaught TypeError: Argument 1 passed to WPML_Media_Post_Images_Translation::translate_images_in_post_content() must be an instance of WP_Post, null given, called in /nas/content/live/weedingtech/wp-content/plugins/wpml-media-translation/classes/media-translation/class-wpml-media-post-images-translation.php on line 98 and defined in /nas/content/live/weedingtech/wp-content/plugins/wpml-media-translation/classes/media-translation/class-wpml-media-post-images-translation.php:121\nStack trace:\n#0 /nas/content/live/weedingtech/wp-content/plugins/wpml-media-translation/classes/media-translation/class-wpml-media-post-images-translation.php(98): WPML_Media_Post_Images_Translation->translate_images_in_post_content(NULL, 'fr', 'en')\n#1 [internal function]: WPML_Media_Post_Images_Translation->translate_images(5)\n#2 /nas/content/live/weedingtech/wp-includes/class-wp-hook.php(288): call_user_func_array(Array, Array)\n#3 /nas/content/live/weedingtech/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array)\n#4 in /nas/content/live/weedingtech/wp-content/plugins/wpml-media-translation/classes/media-translation/class-wpml-media-post-images-translation.php on line 121, referer: hidden link

June 24, 2019 at 3:09 am #4074211



Welcome to WPML Support forum.

Could you please try these steps and see if it resolves the issue?

Note: Please make sure to make a complete backup of your site before proceeding.

-Go to WPML>>Support page
-Click on Troubleshooting link (link in the middle of the page)
-In Troubleshooting page, please click on the following options of 'Clean up' section. Wait for confirmation of processing after each one.
- Clear the cache in WPML
- Remove ghost entries from the translation tables
- Fix element_type collation
- Set language information
- Assign translation status to duplicated content
- Fix terms count
- Fix post type assignment

Please let me know how it goes.

Kind regards,

The topic ‘[Closed] php fatal error with WPML Media plugin when saving a page/post’ is closed to new replies.