Skip Navigation

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

Problem:
The client encountered an issue where products imported in Italian were automatically moved to Lithuanian after running a cron job for updating product information using WPML and WP All Import Multilingual plugin.
Solution:
We discovered that the problem occurs because the Italian language was set to hidden. When a language is hidden, and a cron job is executed, WPML defaults to creating the product in the primary language instead of the intended hidden language. This is due to hidden languages being visible only to logged-in users, and therefore, not accessible to cron requests.
To resolve this, we recommend:
1. Unhide the Italian language.
2. Import the products as drafts.
3. Publish the products once they are ready.

Please note that this solution might not apply to your situation if it's outdated or not relevant to your specific case. If the issue persists, we highly recommend checking the related known issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. Should you need further assistance, please open a new support ticket.

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 13 replies, has 3 voices.

Last updated by Mohamed Sayed 1 year, 2 months ago.

Assisted by: Mohamed Sayed.

Author Posts
February 20, 2024 at 11:22 am #15322227

mariusZ-2

Hello,

We have a strange problem. Our website is available in several languages. We are using WPML and WP All Import Multilingual plugin. We have imported the products from the supplier file into Italian language. When we ran a cron command to automatically update the product information from the supplier file, the products moved from Italian to Lithuanian. They should have remained in Italian.

Why did this happen and how to fix it?

February 21, 2024 at 8:47 am #15325959

Nigel
WPML Supporter since 02/2016

Timezone: Europe/Madrid (GMT+02:00)

Hi there

Before this is taken by a colleague, let me share some thoughts and get some more information.

What you are describing is certainly unexpected. It may not help much now, but for future reference you should always time a backup before conducting bulk operations on your site so that you can revert if problems arise. (If you do have a backup, that will be the simplest solution.)

WP All Import Pro includes extensive logs for each operation which may contain clues as to why this happened; we'd need to take a look at those logs, as well as check the import settings and see details of the file being imported.

So let me request access to your site if that's okay so we can take a look.

We may need to propose a code snippet to perform a batch operation to update the language of the affected products to revert them to Italian.

Where there any other jobs run at about the same time?

February 22, 2024 at 1:15 pm #15333708

Mohamed Sayed

Hi,
First of all, sorry for the late reply due to a higher workload.

I've escalated this issue to our 2nd tier support team for further investigation and will update you once I get their reply.

Kind regards,
Mohamed

February 24, 2024 at 12:27 am #15339707

Mohamed Sayed

Hi,

We checked the site and found that in the WPML All Import metabox, the language is set to Italian but the "Automatic Record Matching to Translate" is set to Import data in main language (Lithuanian) which is incorrect hidden link

You need to expand the "Automatic Record Matching to Translate" section, select the Define parent import option then select the file that you used to import the default language posts and make sure the Unique Identifier is the same as the one set during the default language import.

Then you can run the import again and check if the issue is resolved. Please check this guide for more details: https://wpml.org/documentation/related-projects/wpml-all-import-plugin-website-import-with-wpml/importing-multiple-languages-with-wp-all-import-and-wpml/#import-the-secondary-language-file

Let us know please if that helps.

February 27, 2024 at 8:08 am #15347529

mariusZ-2

Hello,

We still need help. I'll be a bit more specific about what we need and what exactly the problem is:

We do not need this method - https://wpml.org/documentation/related-projects/wpml-all-import-plugin-website-import-with-wpml/importing-multiple-languages-with-wp-all-import-and-wpml/#import-the-secondary-language-file , because we don't need to import and update products in multiple languages. We translate products later into other languages manually (without import).

We need to import the products in Italian only and update the stock and prices in Italian via cron command. However, when the cron command is executed, the products are moved from Italian to English. It should remain in Italian.

February 27, 2024 at 3:47 pm #15349952

Mohamed Sayed

Hi,

I checked again with the 2nd tier support team, we didn't test if importing the products is supposed to work in this way. Please run an import and then run the corn again and let us know if the same issue happens.

We need to check if the problem is the Cron or updating the products.

February 28, 2024 at 7:33 am #15351976

mariusZ-2

Hi, we checked it again. When starting the import system via the dashboard, the products are settling fine, in Italian. Also, they remain in Italian if we restart the import via the dashboard by updating the existing imported products. However, when running the cron command, the products move to Lithuanian, should remain in Italian.

February 28, 2024 at 9:25 am #15352813

Mohamed Sayed

Thanks, I shared this with our 2nd tier supporters and waiting for their feedback.

February 28, 2024 at 2:53 pm #15354434

Mohamed Sayed

Hi,

1. Kindly create a copy of your site and provide a link to download it. You can use the Duplicator plugin (https://wordpress.org/plugins/duplicator/) or the All-in-One WP Migration plugin (https://wordpress.org/plugins/all-in-one-wp-migration/).

The plugin will create a package file that you can download then upload again to Google Drive or Dropbox and share the download link in the next reply which I have marked as private. Then we will escalate this issue to our developers.

2. Please provide a copy of the import file.

Please check here for more details: https://wpml.org/faq/provide-supporters-copy-site/

Thanks for your cooperation.

February 28, 2024 at 9:36 pm #15355806

Mohamed Sayed

Thanks, I escalated this package to our developers and will let you know once I have any updates.

March 4, 2024 at 2:48 pm #15370260

Mohamed Sayed

Hi,

I got the reply from our developers, the provided package is incomplete missing the WP files and most importantly wp-content folder that contains plugins/themes.

They also tried to replicate this in a clean installation with the same steps, but it worked fine. When updating posts using CRON the posts remain in 2nd language even without importing them first in the primary language.

Please provide a complete package, you can use the All-in-One WP Migration plugin (https://wordpress.org/plugins/all-in-one-wp-migration/) if Duplicator doesn't work.

Alternatively, you can grant me permission to install the above plugin and get the copy from my side.

March 4, 2024 at 4:00 pm #15371118

mariusZ-2

Hello, well then we give you permission to make a copy with All-in-One WP Migration plugin or any other one, because Duplicator doesn't prepare all files for some reason.

March 4, 2024 at 8:34 pm #15371999

Mohamed Sayed

Thanks, I created a new package and shared it with our developers.

March 6, 2024 at 9:39 am #15378184

Mohamed Sayed

Thanks for your patience!

Our developers found that this issue happens because the Italian language is hidden. When you hide the language then the Cron runs, WPML creates the product in the primary language instead of Italian.

This is because the language is not active and hidden languages are only visible to logged-in users so CRON requests can not find it.

Please unhide the language and instead you can import the product as draft and then publish them later.

Kind regards,
Mohamed

March 6, 2024 at 10:33 am #15378447

mariusZ-2

Thank you for your promptness and quick identification of the problem. Best regards.