Skip Navigation

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

Problem: the imports done though WP All import are not visible in the post unless “Set Language information” is clicked from WPML > Troubleshooting.

Solution: this is happening because the option “Increase speed by disabling do_action calls in wp_insert_post during import” is active. If you disable action calls, you are basically disabling WPML All Import, therefore this option should NOT be activated.

Relevant Documentation: https://wpml.org/errata/wp-all-import-issues-when-option-increase-speed-by-disabling-do_action-calls-in-wp_insert_post-during-import-is-enabled/

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.

Our next available supporter will start replying to tickets in about 1.98 hours from now. Thank you for your understanding.

This topic contains 16 replies, has 2 voices.

Last updated by jaakI 5 months ago.

Assigned support staff: Laura.

Author Posts
February 19, 2020 at 12:11 pm #5523487

jaakI

Hello Laura,

Ok, I understand. Right now it's urgent to find the fix to the problem from this topic. One live site is waiting to load the second language. Because of every night, cron job will update products it's important that the import process works flawlessly without creating duplicate variations and not losing variation description.

But the two other topics are existing in two live sites. Right now there are WP All Import Multilingual turned off. And these problems started last year for both sites accidentally. One day import to the main language with WP All Import Multilingual active works without problems but the second day it has started to create import fatal error and I have to turn it off. I've tried, but I can't find how to create this problem artificially.

February 19, 2020 at 12:13 pm #5523495

Laura
Supporter

Languages: English (English ) Italian (Italiano ) Portuguese (Brazil) (Português )

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

Ok, I split the ticket so we can continue here.

Could you please do a resume of the issue - I think related to empty product database and explain exactly what you did until now so I can decide how it's better to proceed?

February 24, 2020 at 8:31 am #5552163

jaakI

I talle sometime and I'll try to reproduce it.

February 24, 2020 at 11:29 am #5553791

Laura
Supporter

Languages: English (English ) Italian (Italiano ) Portuguese (Brazil) (Português )

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

Ok, thank you. I'll wait for your update.

February 25, 2020 at 7:13 am #5559485

jaakI

Hello Laura,

I can access the frontend of the previous demo but not backend anymore.
Could you please set up a new demo or send credentials to the old one.

February 26, 2020 at 8:29 am #5568773

Laura
Supporter

Languages: English (English ) Italian (Italiano ) Portuguese (Brazil) (Português )

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

Hi,

I created a new fresh installation for you, as it's better not to mix problems on the same test site.

Here's the link hidden link
It will expire in a month so you have all the time to try and reproduce.

March 4, 2020 at 8:33 am #5613837

jaakI

Hello,

As I said before I can't find the procedure what exact actions are needed to create errors under discussion in this topic.

I have managed to get these errors on my own test site: hidden link.

I was before able to fix this test site (I downgraded Woocommerce Multilingual, reinstalled WPML) and for a while, the main lang import has worked as expected. Now it has suddenly stopped to work. Therefore I think this test site can be used to find what is the cause of these errors. I have all the backups to get back to the previous state.

  • Woocommerce through fatal error then WP All Import Multilingual plugin is active
  • If WP All Import Multilingual is not active import is working, but language information to the new products is not set. New products become visible only after firing WPML -> Support -> Troubleshooting -> Set Language Information

How can I send you credentials to this test site?
You can duplicate the site to another domain by using the Akeeba Backup archive (to extract archive download: hidden link).

March 4, 2020 at 11:21 am #5616031

Laura
Supporter

Languages: English (English ) Italian (Italiano ) Portuguese (Brazil) (Português )

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

Hi,

I'm enabling a private reply.
Also, what is the error you have exactly?

March 4, 2020 at 1:54 pm #5617541

Laura
Supporter

Languages: English (English ) Italian (Italiano ) Portuguese (Brazil) (Português )

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

Hi,

the trid is the translation id. If you don't have it, WPMLAI can't link the different posts as translation. If this value is missing, it's normal that the product can't be copied.

It's also expected that if you disable WPMLAI the language information is not set - because WP All Import can't add it on its own.

I would ask you to:
- find the variation with ID 39041
- see which is the ID of its main product
- check in the database table wp_posts if the trid for the main product is empty or not
If it's empty, you should find which is (looking at trid for a translated version for example) and set it.

March 5, 2020 at 7:01 am #5622585

jaakI

Hello Laura,

Sorry, but your last answer is confusing.

I will try to explain my setup process.

  • Install wordpress
  • Install Woocommerce
  • Setup woocommerce
  • Install WPML (2 langs) + Woocommerce Multilingual + WP All Import Multilingual
  • Setup WPML using default wizards
  • Wipe Woocommerce default products, categories etc
  • Install WP All Import + Woocommerce plugin
  • Import or create import template:
    Wp All Import Multilingual correctly understands that this is the first import and selects main language.
  • Run import to the main lang

Does this workflow logical to you?

Running this on your demo site: hidden link

Expected result: Products to the main lang will be imported
Actual result: 2020-03-05T06:37:11+00:00 CRITICAL Uncaught Exception: No trid for product variation in secondary language, imposssible to set _wcml_duplicate_of_variation in /mnt/BLOCKSTORAGE/home/351980.cloudwaysapps.com/yfxajnzwdc/public_html/wp-content/plugins/wpml-all-import/wpml-all-import.php:312
Stack trace:
#0 /mnt/BLOCKSTORAGE/home/351980.cloudwaysapps.com/yfxajnzwdc/public_html/wp-includes/class-wp-hook.php(290): WPAI_WPML->saved_post(65)
#1 /mnt/BLOCKSTORAGE/home/351980.cloudwaysapps.com/yfxajnzwdc/public_html/wp-includes/class-wp-hook.php(312): WP_Hook->apply_filters('', Array)
#2 /mnt/BLOCKSTORAGE/home/351980.cloudwaysapps.com/yfxajnzwdc/public_html/wp-includes/plugin.php(478): WP_Hook->do_action(Array)
#3 /mnt/BLOCKSTORAGE/home/351980.cloudwaysapps.com/yfxajnzwdc/public_html/wp-content/plugins/wp-all-import-pro/models/import/record.php(3906): do_action('pmxi_saved_post', 65, Object(SimpleXMLElement), false)
#4 /mnt/BLOCKSTORAGE/home/351980.cloudwaysapps.com/yfxajnzwdc/public_html/wp-content/plugins/wp-all-import-pro/controllers/admin/import.php in /mnt/BLOCKSTORAGE/home/351980.cloudwaysapps.com/yfxajnzwdc/public_html/wp-content/plugins/wpml-all-import/wpml-all-import.php on line 312

Therefore:

  • If I did something wrong or misconfigure then would you be kind and say what is wrong in the workflow described previously
  • If you can't point that I did something wrong or illogical - then WP All Import Multilingual contains a bug or shortcoming
March 5, 2020 at 9:05 am #5623395

jaakI

Hello Laura,

I've created an additional localhost test site and seems that maybe I managed to sort out what is causing errors described in previous posts:

In WP All Import -> Import settings -> Configure Advanced Settings I have option "Increase speed by disabling do_action calls in wp_insert_post during import" activated.

This option deactivates the next hooks:
This option is for advanced users with knowledge of WordPress development. Your theme or plugins may require these calls when posts are created. Next action will be disabled: 'transition_post_status', 'save_post', 'pre_post_update', 'add_attachment', 'edit_attachment', 'edit_post', 'post_updated', 'wp_insert_post'.

I've activated this because import/update 6000 products are too time-consuming and therefore I want it to keep activated.

Possible workaround:
WP All Import has a hook "pmxi_save_post" which is fired after each post create/update. What WPML functions/hooks I have to fire to avoid fatal error and that language information after the import is not set.

And I think that it will be a great idea if WP All Import Multilingual will check if WP All Import template has this option active and will warn the user of the possible problems or better WP All Import Multilingual will take care of the WPML required part.

March 5, 2020 at 9:30 am #5623741

Laura
Supporter

Languages: English (English ) Italian (Italiano ) Portuguese (Brazil) (Português )

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

Hi,

this error is different from the previous one, as it doesn't point to a specific entry.

In any case, it seems there is some kind of error with your import file.
Can you please share it with me?

March 5, 2020 at 9:38 am #5623777

jaakI

Hello,
Please check my post from 9.05.

The import file you can get from your sandbox installation: hidden link

/wp-content/uploads/wpallimport/files

March 6, 2020 at 8:31 am #5632535

Laura
Supporter

Languages: English (English ) Italian (Italiano ) Portuguese (Brazil) (Português )

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

Hi,

I spoke with the WPMLAI dev and he suggested to open /plugins/wpml-all-import/wpml-all-import.php and remove line 312

throw new Exception("No trid for product variation in secondary language, imposssible to set _wcml_duplicate_of_variation");

I tried that on the Sandbox and it seems it's working there. Can you please try and see if it works for you?

March 6, 2020 at 10:29 am #5633915

jaakI

Hello Laura,

Seems that you didn't read my post from MARCH 5, 2020 AT 9:05 AM very carefully.

If in WP All Import template configuration: Template -> Import settings -> Configure Advanced Settings option "Increase speed by disabling do_action calls in wp_insert_post during import" is unchecked when both problems described here are solved.

  • Woocommerce doesn't through the error and I do not have to comment out any line of code in wpml-all-import.php
  • Newly created products get the language information assigned correctly

Your solution + option "Increase speed by disabling do_action calls in wp_insert_post during import" is checked, prevents the Woocommerce fatal error to appear and products can be imported. But the second problem then newly created products don't have assigned language information remains.

What I suggest is:

  • WP All Import Multilingual has to check is an option Increase speed by disabling do_action calls in wp_insert_post during import in the template configuration is checked and if it's active then display warning that this option may cause errors and/or that language information to new products must be set manually.
  • Because speeding up import is important too then if this option is checked then WP All Import Multilingual should deal with actions required only by WPML