Skip Navigation

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

Problem:
After duplicating all my products, some are still showing the "Needs Update" status and the debug log shows the following error:

[10-Apr-2023 18:10:55 UTC] WordPress database error Duplicate entry '20450-he' for key 'trid_lang' for query UPDATE `wp_icl_translations` SET `trid` = '20450', `language_code` = 'he', `source_language_code` = 'en' WHERE `element_type` = 'post_product' AND `element_id` = '36915' made by do_action('wp_ajax_wpml_action'), WP_Hook->do_action, WP_Hook->apply_filters, WPML\LIB\WP\Hooks::WPML\LIB\WP\{closure}, WPML\FP\Promise->resolve, WPML\FP\Promise->resolve, WPML\FP\Promise->resolve, WPML\FP\Promise->resolve, WPML\FP\Promise->resolve, WPML\FP\Promise->resolve, WPML\FP\Right->chain, WPML\FP\Right->map, WPML\Ajax\Factory->WPML\Ajax\{closure}, WPML\FP\Just->map, WPML\FP\{closure}, call_user_func_array, WPML\Container\Container::execute, WPML\Auryn\Injector->execute, call_user_func_array, WPML\Auryn\Executable->__invoke, ReflectionMethod->invokeArgs, WPML\TM\TranslationDashboard\Endpoints\Duplicate->run, WPML\FP\Fns::__callStatic, call_user_func_array, WPML\FP\Fns::WPML\FP\{closure}, call_user_func_array, WPML\FP\Fns::WPML\FP\{closure}, array_map, WPML\FP\{closure}, WPML\TM\TranslationDashboard\Endpoints\Duplicate->WPML\TM\TranslationDashboard\Endpoints\{closure}, SitePress->make_duplicate, WPML_Post_Duplication->make_duplicate, WPML_Post_Duplication->run_wpml_actions, SitePress->set_element_language_details, WPML_Set_Language->set, WPML_Set_Language->change_translation_of

Solution:
If you did a migration or DB search-replace, we suggest restoring the database if possible.

If not, you can run the following query after creating a full database backup:

DELETE FROM `wp_icl_translations` WHERE `element_id` IS NULL

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.

Tagged: 

This topic contains 33 replies, has 3 voices.

Last updated by rabiaA 1 year, 8 months ago.

Assisted by: Mohamed Sayed.

Author Posts
April 12, 2023 at 2:46 pm #13457013

Mohamed Sayed

Hi,

All the products are duplicated on the site copy, you can check it using the credentials in the next private reply.

April 12, 2023 at 2:51 pm #13457057

rabiaA

Wonderful, I will try in my side soon then will confirm if the issue resolved or not.

Thanks for the confirmation.

April 12, 2023 at 2:53 pm #13457065

Mohamed Sayed

You're most welcome!

I will be waiting for your updates.

April 12, 2023 at 5:37 pm #13458629

rabiaA

My issue is resolved now. Thank you!
Well done Muhammad and the 2nd tier support.