Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem: Following fatal Error while doing "Assign translation status to duplicate content" Trubleshoot action

PHP Fatal error: Uncaught InvalidArgumentException: Tried to set status9 for falsy post_id N; in C:\xampp7\htdocs\puntorosso\wp-content\plugins\sitepress-multilingual-cms\classes\post-translation\class-wpml-post-status.php:145

Solution: It was happening because of few of the translation entries of *icl_translations* registered with *element_id* as *NULL*.

1) Log in to your PHPMyAdmin account 2) Choose your database and backup it. Then choose *icl_translations* table 3) Sort the *element_id* field(just click the column header) 4) You can find many records with *NULL* value for *element_id* field 5) Delete all those records 6) Then make sure you are getting the expected result or not

Relevant Documentation: https://wpml.org/forums/topic/error-when-i-press-assign-translation-status-to-duplicate-content/#post-1539460

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 8 replies, has 2 voices.

Last updated by Puntorosso 2 years, 6 months ago.

Assigned support staff: Bigul.

Author Posts
February 27, 2018 at 11:37 am

Puntorosso

Hi,
I get "error" or "HTTP/2.0 500" when I press "Assign translation status to duplicated content" in the troubleshooting page.

Is that normal?

Thanks

Best

February 27, 2018 at 6:33 pm #1530960

Bigul
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hi Puntorosso,

Welcome to the WPML support forum. I will do my best to help you to resolve these issues.

Please let me know the following for a better understanding.

1) Please share with me the WordPress debug.log (not WPML debug information). Please check this page for instructions https://wpml.org/documentation/support/debugging-wpml/

To enable it, open your wp-config.php file and look for define(‘WP_DEBUG’, false);. Change it to:

// Enable WP_DEBUG mode
define( 'WP_DEBUG', true );
 
// Enable Debug logging to the /wp-content/debug.log file
define( 'WP_DEBUG_LOG', true );
 
// Disable display of errors and warnings 
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );

// Use dev versions of core JS and CSS files (only needed if you are modifying these core files)
define( 'SCRIPT_DEBUG', true );

In this case, the errors will be saved to a debug.log log file inside the */wp-content/* directory. Please do the steps to reproduce the bug and check you are getting any errors or warning related to WPML in the log file.

If you can paste your debug.log to http://pastebin.com/index.php and provide me that link it would be great! (This is the cleanest way because sometimes the logs are long and create a complete mess of discussion).

2) Please check you are getting any JavaScript error in the browser console or not

3) Please share me a couple of screenshots for a better understanding.

--
Thanks!

Bigul

March 4, 2018 at 3:48 pm #1535467

Puntorosso

Hi Bigul,

this is the same WP install you were debugging here

https://wpml.org/forums/topic/broken-link-with-duplicate-post/

You just asked to open a new thread for this as your support policies can only handle one issue per ticket.

The logs are the same, so I think is redundant to re-do the complete support procedure.

Thanks

Best

March 5, 2018 at 3:31 pm #1536522

Bigul
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hi Puntorosso,

Thank you for the feedback. I have requested it again as a part of our debugging procedure. Becuase maybe there will be a chance for PHP warnings or errors in the *debug.log* file.

I have a request. Please allow me to make a duplicator copy of your site using Duplicator plugin(https://wordpress.org/plugins/duplicator/) for debugging the issue on my local server.

--
Thanks!

Bigul

March 5, 2018 at 4:27 pm #1536601

Puntorosso

Sure, go ahead. Login datas are the same as in the other thread. Thanks.

March 6, 2018 at 7:44 am #1537184

Bigul
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hi Puntorosso,

Thank you for the permission. I made a duplicator copy of your site now. Will debug it further on my local server and get back to you soon. Please wait.

--
Thanks!

Bigul

March 6, 2018 at 5:26 pm #1538011

Bigul
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hi Puntorosso,

For your kind information, this issue is happening because of the following error. This bug is existing after the initial debugging procedures and not able to reproduce this issue in a fresh installation. Therefore I have forwarded the details to our second tier team for the expert opinion. We will get back to you as soon as possible. Please wait.

PHP Fatal error:  Uncaught InvalidArgumentException: Tried to set status9 for falsy post_id N; in C:\xampp7\htdocs\puntorosso\wp-content\plugins\sitepress-multilingual-cms\classes\post-translation\class-wpml-post-status.php:145
Stack trace:
#0 C:\xampp7\htdocs\puntorosso\wp-content\plugins\sitepress-multilingual-cms\menu\troubleshooting.php(240): WPML_Post_Status->set_status(NULL, 9)
#1 C:\xampp7\htdocs\puntorosso\wp-admin\admin.php(253): include('C:\\xampp7\\htdoc...')
#2 {main}
  thrown in C:\xampp7\htdocs\puntorosso\wp-content\plugins\sitepress-multilingual-cms\classes\post-translation\class-wpml-post-status.php on line 145

--
Thanks!

Bigul

March 7, 2018 at 4:27 pm #1539460

Bigul
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hi Puntorosso,

We have traced the reason for the bug. It is happening because of few of the translation entries of *icl_translations* registered with *element_id* as *NULL*. Please check the attached images for more details.

Please try the following steps after a full site backup and let me know your feedback.

1) Log in to your PHPMyAdmin account
2) Choose your database, then *icl_translations* table
3) Sort the *element_id* field(just click the column header)
4) You can find many records with *NULL* value for *element_id* field
5) Delete all those records
6) Then make sure you are getting the expected result or not

--
Thanks!

Bigul

March 7, 2018 at 9:54 pm #1539823

Puntorosso

That did the trick! Thanks a lot for your help.
Best