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: Bug
This topic contains 14 replies, has 2 voices.
Last updated by Mykola Kareiev 3 years ago.
Assisted by: Nicolas V..
| Author | Posts |
|---|---|
| January 27, 2023 at 8:28 pm #12906595 | |
|
Mykola Kareiev |
I'm importing products into the site using the WP all import plugin in the site's main language. The site is in 3 languages. The import is successful and my products are visible on the site in the main language. But WPML doesn't start automatically translating them. In the settings it is indicated to translate everything. |
| January 28, 2023 at 12:21 pm #12908863 | |
|
Nicolas V. Supporter
Languages: English (English ) French (Français ) Timezone: America/Lima (GMT-05:00) |
Hello, Welcome to the WPML support forum. My name is Nicolas and I will be happy to help you today. Unfortunately this is expected behavior, as my colleague explained here: https://wpml.org/forums/topic/automatically-translated-products-added-using-wp-all-import/
Nico |
| January 28, 2023 at 7:21 pm #12909611 | |
|
Mykola Kareiev |
Hello Nicolas, Thank you in advance |
| January 28, 2023 at 8:45 pm #12909783 | |
|
Nicolas V. Supporter
Languages: English (English ) French (Français ) Timezone: America/Lima (GMT-05:00) |
Hello, 1. The standard WordPress hook 'save_post' triggers WPML to check for updates on translation. It should be enough to send them to automatic translation. Ref: https://developer.wordpress.org/reference/hooks/save_post/ 2. ATE comes with a "Translation memory" and is able to detect if a segment has been translated before and use that translation in order to save credits. I've cleared your translation memory. It can some time to be completely deleted so please wait few hours before trying to translate. |
| January 31, 2023 at 6:43 pm #12932937 | |
|
Mykola Kareiev |
I'm sorry but I still need help
function test_script()
{
$post_id = 3597;
$post = get_post($post_id);
wp_update_post(array(
'ID' => $post_id,
'post_content' => '',
'post_status' => 'publish',
));
do_action("save_post_product", $post_id, $post, true);
do_action('save_post', $post_id, $post, true);
}
add_action("wp_head", "test_script", 0);
function my_saved_post($post_id, $xml_node, $is_update)
{
$import_id = wp_all_import_get_import_id();
if ($import_id == '5' && $is_update == false) {
$post = get_post($post_id);
do_action('save_post', $post_id, $post, false);
}
}
add_action('pmxi_saved_post', 'my_saved_post', 10, 3);
|
| January 31, 2023 at 10:07 pm #12933533 | |
|
Nicolas V. Supporter
Languages: English (English ) French (Français ) Timezone: America/Lima (GMT-05:00) |
Hello, Please kindly note that custom code/work is out of the scope of our support but I escalated your ticket to the second tier support to see if they have any helpful feedback to help you out. I'll get back to you as soon as I have an answer. |
| February 1, 2023 at 2:39 pm #12939201 | |
|
Nicolas V. Supporter
Languages: English (English ) French (Français ) Timezone: America/Lima (GMT-05:00) |
Hello, In order for our dev team to have a closer look, we need to reproduce this scenario on our servers. I have created this clean sandbox setup for you: - I would need you to set up WPML + the WPML add-ons as you have them on your site (they are already installed) and to also install WP All import and try to recreate the issue. Please don't install any other plugins that are not necessary to reproduce the issue. Thanks, |
| February 1, 2023 at 6:09 pm #12941387 | |
|
Mykola Kareiev |
I sandboxed the core functionality of my site and everything works great. So the problem is in my site. I will further disassemble it myself, recreating my site gradually in the sandbox, to determine at what stage the problem occurs. |
| February 1, 2023 at 7:30 pm #12941765 | |
|
Mykola Kareiev |
I found what my problem is. Automatic translation does not work when using php8.0+. |
| February 1, 2023 at 8:23 pm #12941897 | |
|
Nicolas V. Supporter
Languages: English (English ) French (Français ) Timezone: America/Lima (GMT-05:00) |
Hello, To clarify, the issue appears when you upgrade to PHP 8+ only on your production site or even on your sandbox? If it happens on both, then it could be an issue compatibility with our plugin WPML All Import. In that case I need to report it as soon as possible. Do you mind providing us a Duplicator copy of your sandbox to run some tests? Once the problem is resolved I will delete the local site. Let me know if this is ok with you. Nico |
| February 2, 2023 at 3:04 am #12942933 | |
|
Mykola Kareiev |
The problem is definitely with your WPML All import plugin. |
| February 2, 2023 at 1:48 pm #12947961 | |
|
Nicolas V. Supporter
Languages: English (English ) French (Français ) Timezone: America/Lima (GMT-05:00) |
Hello, Thank you for testing this thoroughly and sharing your findings. I have forwarded your feedback to the second tier support team and will get back to you as soon as possible. Nico |
| February 4, 2023 at 12:23 pm #12960521 | |
|
Nicolas V. Supporter
Languages: English (English ) French (Français ) Timezone: America/Lima (GMT-05:00) |
Hello, Thanks for reporting this issue, it has been escalated to the dev team. In the meantime here is a workaround: The workaround is to comment-out the calls in the file wp-content/plugins/wpml-all-import/classes/WCML.php add_action( 'deleted_post_meta', [ $this->getWCMLSynchronizeProductData(), 'delete_empty_post_meta_for_translations' ], 10, 3 ); and remove_action( 'deleted_post_meta', [ $WCMLSynchronizeProductData, 'delete_empty_post_meta_for_translations' ], 10, 3 ); Could you please confirm that this solves your issue? |
| February 4, 2023 at 2:15 pm #12960727 | |
|
Mykola Kareiev |
Hello Nico |