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 7, 2023 at 3:10 pm #13428117

rabiaA

I am trying to: Duplicate Hebrew Products

Link to a page where the issue can be seen:

I expected to see: Duplication success

Instead, I got: Hebrew: Needs Update.

I'm not able to see what is the error or what exactly needed to update exactly.

Screen Shot 2023-04-07 at 17.46.28.png
April 7, 2023 at 3:13 pm #13428169

Andreas

Hi,

before your ticket is assigned to one of my colleagues, please allow me to walk you through some initial debugging steps. This will help speed up the support process.

May I ask you to give more information on what you are trying to do?

You are trying to use WooCommerce Duplication or WPML Duplication because is totally different thigs

WooCommerce Duplication is use an old product that you can copy to a new one and wpml duplication is mirroring between languages.

https://wpml.org/documentation/translating-your-contents/displaying-untranslated-content-on-pages-in-secondary-languages/

Maybe sharing a screencast will also helps a lot.

Regards,
Andreas

April 7, 2023 at 3:18 pm #13428179

rabiaA

I know how duplication works, In Arabic it works perfectly but in hebrew it's giving for half of the products the below error:

Hebrew: Needs Update.

I don't know what exactly needed here!
Again, All the products duplicated but many in hebrew with Errors and not able to see the Prices for example therefore can't add to cart.

April 7, 2023 at 3:21 pm #13428183

Andreas

My apologies but based on your reply I cannot understand which duplication you are referring too. Because if you are using WPML you should see in all languages the same content.

May I ask you to create a screencast showing an example of the issue you are facing? Please do the whole process in the backend in order to understand better your procedures.

You can use loom.com if you wish for quicker results.

Thank you

Regards,
Andreas

April 7, 2023 at 3:22 pm #13428185

rabiaA

As you can see that the Arabic duplicated successfully, the Hebrew not fully duplicated.

Screen Shot 2023-04-07 at 17.46.28.png
April 7, 2023 at 3:31 pm #13428241

Andreas

Thank you.

The above screenshot is not helping in order to understand the source of the problem and help you with a fix.

Please follow my suggestion and create a screenshot showing the whole process you are following. Then it will be much easier to find a solution.

Thank you very much in advance.

Regards,
Andreas

April 7, 2023 at 4:17 pm #13428347

rabiaA

I still don't understand what exactly not clear!

I'm telling you that I'm not able to duplicate part of the Hebrew files, all the Arabic files duplicated from the English successfully apart many Hebrew files.

I've also tried to access the Original file in English and also tried to Do duplicate as you can see in the Screenshot but nothing duplicated.

The question is where I can find those Errors cause it's not displaying any clear error only that those files status are Hebrew: Need update but nothing letting me to update those files.

Screen Shot 2023-04-07 at 19.14.37.png
April 8, 2023 at 9:45 am #13431145

rabiaA

Please check and advise, Your software not working ok,
How come same English file duplicated successfully in Arabic but not in Hebrew.

I think it's a critical bug that you should be aware of it,

BTW, I have the latest version of WPML.

April 9, 2023 at 2:25 pm #13434285

Mohamed Sayed

Hi there,
Sorry for the late reply due to the weekend. My name is Mohamed, and I will be glad to help you.

1) Please go to WPML > Translation Management > Translators tab, and make sure that your user account is added as a translator and has the correct language pairs (Including from the default language to Hebrew).

2) Make sure that you have a full database and website backup, then Please go to WPML > Support > Troubleshooting page, then click the following:
- Clear the Cache in WPML
- Remove ghost entries from the translation tables
- Fix element_type collation
- Fix WPML table collation
- Set language information
- Fix post type assignment for translations

3) Once the above steps are done, please bulk duplicate those products to Hebrew and check if the issue is resolved. Kindly check this guide for more details about how to duplicate pages and posts in bulk: https://wpml.org/documentation/translating-your-contents/displaying-untranslated-content-on-pages-in-secondary-languages/#how-to-duplicate-pages-and-posts-in-bulk

Let me know please if that helps.

Regards,
Mohamed

April 9, 2023 at 2:57 pm #13434317

rabiaA

Salam Alaykom Sir Muhammad,

Thanks and I think it's not set as expected as I see English to Arabic and Arabic to English only there.

I've added the Hebrew there as well now, You think it's what's causing the issue?

April 9, 2023 at 3:26 pm #13434333

rabiaA

I've did the same but still same issue.

I've tried to duplicate only one with this issue and identified that it's writing a source code ...
please check the screenshot, but again same is working fine in Arabic.

Screen Shot 2023-04-09 at 18.24.34.png
April 10, 2023 at 12:32 am #13434817

Mohamed Sayed

Hi,

Please provide me with the WordPress debug.log, this will allow us to see if any PHP errors are being produced. More Info: https://wordpress.org/support/article/debugging-in-wordpress/

To enable it, open your wp-config.php file and look for:

define('WP_DEBUG', false);

And change it to:

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 which is recommended on a live site.
define('WP_DEBUG_DISPLAY', false);
@ini_set('display_errors',0);

Then try to reproduce the issue by duplicating one product to Hebrew and check if any errors were saved to the debug.log log file inside the /wp-content/ directory
If you can paste your debug.log to https://pastebin.com/ and provide me that link, it would be great!

Also, could you please check if the issue persists in a minimal environment by following these steps?

- Deactivate all the plugins that are not related to WPML (Keep Elementor activated)
- Switch for a moment to a WordPress default theme like Twenty Twenty-one
- Duplicate a product

❌ Please backup your database and website before performing the above test ❌

Let me know please how that goes.

April 10, 2023 at 6:13 pm #13439437

rabiaA

I got the debug details as below:

[10-Apr-2023 18:08:36 UTC] PHP Deprecated: Function Elementor\Widgets_Manager::register_widget_type is deprecated since version 3.5.0! Use register instead. in /home/abucastro.com/public_html/wp-includes/functions.php on line 5413
[10-Apr-2023 18:08:36 UTC] PHP Deprecated: Function Elementor\Widgets_Manager::register_widget_type is deprecated since version 3.5.0! Use register instead. in /home/abucastro.com/public_html/wp-includes/functions.php on line 5413
[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
[10-Apr-2023 18:11:49 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` = '36916' 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

April 10, 2023 at 6:17 pm #13439449

rabiaA

Please assist ASAP, it's blocking the production.

April 10, 2023 at 10:12 pm #13440543

Mohamed Sayed

Hi,

1. Please create a full backup of the database and website then try the workaround provided here: https://wpml.org/forums/topic/duplicate-entry-1616-de-for-key-wp_icl_translations-trid_lang-for-query-update-wp_icl_translations/#post-12902959

2. Update Elementor to the latest version

Let me know please if that helps