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 thread is resolved. Here is a description of the problem and solution.

Problem:Error message after page update

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 /home/lilili/public_html/wp-content/plugins/wpml-media-translation/classes/media-translation/class-wpml-media-post-images-translation.php on line 107 and defined in /home/lilili/public_html/wp-content/plugins/wpml-media-translation/classes/media-translation/class-wpml-media-post-images-translation.php:130

Solution:1. Go to WPML > Support > Troubleshooting 2. Click on the button "Remove ghost entries from the translation tables".

Relevant Documentation:

This topic contains 9 replies, has 2 voices.

Last updated by lidiaS-3 3 months, 1 week ago.

Assigned support staff: Bobby.

Author Posts
June 19, 2019 at 3:13 pm #4052659

lidiaS-3

I am trying to: update a page

Link to a page where the issue can be seen: any page of the site

I expected to see: updated page

Instead, I got: error message

June 19, 2019 at 7:58 pm #4054437

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Hello,

if possible please increase your WP_MEMORY_LIMIT to 256M or higher and let me know your results [if its set to 256M already try to increase it higher , but from your debug information i see it set to 40M ]
=> https://wordpress.org/support/article/editing-wp-config-php/#increasing-memory-allocated-to-php

if that does not resolve the issue

I would need to see the detail of the error log. You can see how to enable debug logging here:
https://wpml.org/documentation/support/debugging-wpml/

Go in your wp-config.php file and look for define(‘WP_DEBUG’, false);. Change it to:
define('WP_DEBUG', true);

Edit your wp-config.php file and add these lines, just before it says 'stop editing here':

ini_set('log_errors',TRUE);
ini_set('error_reporting', E_ALL);
ini_set('error_log', dirname(__FILE__) . '/error_log.txt');

This will create an error_log.txt file in your site's root directory. Please send me its contents.

June 22, 2019 at 11:39 am #4070989

lidiaS-3

Hi, thank you and sorry for the delay in reacting!

Opened wp-conig.php - changed 'false' to 'true' ans added lines.

have no error_log.txt created. Only have one old from ten days ago.

Thanks for your help, what should I do?

June 24, 2019 at 5:58 pm #4079101

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

If possible i would like to take a closer look at the backend to further test this issue

**Before we proceed I recommend to please take FULL BACKUP of your database and your website.**
I often use the Duplicator plugin for this purpose See: http://wordpress.org/plugins/duplicator/

I would like to request temporary access (wp-admin and FTP) to your site to fix the issue.
(preferably to a test site where the problem has been replicated if possible)

You will find the needed fields for this below the comment area when you log in to leave your next reply.
The information you will enter is private which means only you and I can see and have access to it.

Thank you,
Bobby

July 6, 2019 at 9:53 pm #4156421

lidiaS-3

Hi, Bobby, sorry for being slow as hell, am figuring our how to do this test site thing.

Best.

July 8, 2019 at 5:49 pm #4164797

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Thank you for updating me ,

no problem , if you wish we can also migrate the site to our staging environment to further test without interfering with your live site or get a duplicator package to test locally

if you wish to proceed this way you can simply provide me with the access details and i will do the rest

July 11, 2019 at 6:39 pm #4192663

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Hi There,

is this happening with all your pages or just a few ?

i have tried updating some pages and it worked as expected without an error , if possible please provide me with the steps to reproduce the issue

July 11, 2019 at 10:21 pm #4193313

lidiaS-3

Hi there,

Page "Temoignage" is one of the pages with this issue screenshot 1)

and then I get an email (screenshot 2)

Thanks!

July 13, 2019 at 1:26 am #4201923

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Thank you, i was able to reproduce the issue and logged the following error

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 /home/lilili/public_html/wp-content/plugins/wpml-media-translation/classes/media-translation/class-wpml-media-post-images-translation.php on line 107 and defined in /home/lilili/public_html/wp-content/plugins/wpml-media-translation/classes/media-translation/class-wpml-media-post-images-translation.php:130 Stack trace: #0 /home/lilili/public_html/wp-content/plugins/wpml-media-translation/classes/media-translation/class-wpml-media-post-images-translation.php(107): WPML_Media_Post_Images_Translation->translate_images_in_post_content(NULL, Object(WPML_Post_Element)) #1 /home/lilili/public_html/wp-includes/class-wp-hook.php(288): WPML_Media_Post_Images_Translation->translate_images(3031) #2 /home/lilili/public_html/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array) #3 /home/lilili/public_html/wp-includes/plugin.php(465): WP_Hook-> in /home/lilili/public_html/wp-content/plugins/wpml-media-translation/classes/media-translation/class-wpml-media-post-images-translation.php on line 130

This helped me identify a known error that can be resolved with the following steps

1. Go to WPML > Support > Troubleshooting
2. Click on the button "Remove ghost entries from the translation tables".

i have already done this for you and was able to successfully save the page.

July 13, 2019 at 11:42 am #4203405

lidiaS-3

Hi, Bobby,

Done and issue solved.

A sincere thanks for your help and your patience!