Home›Support›English Support›[Resolved] the synchronization of the attributes fails me on one fatal error,
[Resolved] the synchronization of the attributes fails me on one fatal error,
This thread is resolved. Here is a description of the problem and solution.
Problem: The client was experiencing a fatal error when trying to synchronize attributes and translate products in bulk using WPML and WooCommerce. The error was a TypeError in
wc-attribute-functions.php
indicating that an array was given where a string was expected.
Solution: We recommended the following troubleshooting steps: 1. Navigate to WPML -> Support -> Troubleshooting and perform the following actions: - Synchronize posts taxonomies (for products and then for variations) - Clear the cache in WPML - Remove ghost entries from the translation tables - Set language information - Fix terms count - Fix post type assignment for translations
If the issue persists, we suggested: 1. Installing the Adminer plugin to investigate the database entries for the problematic product IDs. 2. Checking if the mentioned product IDs are valid and not in a corrupted state. 3. Bulk editing products in WordPress to potentially fix corrupted data.
If these steps do not resolve the issue, we advised the client to open a new support ticket for further assistance. We also highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins.
If the solution provided here is not relevant to your case, either because it's outdated or not applicable, please do not hesitate to open a new support ticket with us for personalized assistance at WPML support forum.
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.
I already tried to discuss one thing with the support, the synchronization of the attributes fails me on one fatal error, could you give me some advice?
It would seem that this is cause by a post with the ID of 6556, but this doesn't seem to be a product as on hidden link I get "Sorry, you are not allowed to edit posts in this post type".
The problematic product was in the trash, so it could not be accessed, I deleted it, the synchronization then went well, but I still cannot translate the products in bulk.
When trying to bulk translate, for example, 4 products, it displays the following error:
The products then get into the "queue" - hidden link and remain there until I make a "resave" for the given product in the basic language.
We need to translate the products in bulk, could you help me with that? Could you try translating multiple products at once via "Translation Management"?
Languages: English (English )German (Deutsch )French (Français )
Timezone: Europe/Zagreb (GMT+02:00)
The error log mentions a product ID. It appears in several lines of the stack trace, specifically:
- Line 6: `WC_Product_Simple->__construct(6650)`
- Line 7: `WC_Product_Variation->__construct(6650, Array)`
- Line 8: `WC_Product_Factory->get_product(6650, Array)`
- Line 9: `wc_get_product(6650)`
- Line 10: `WCML_Synchronize_Variations_Data->sync_product_variations(6340, 6646, 'en', Array)`
- Line 11: `WCML_Synchronize_Product_Data->sync_product_data(6340, 6646, 'en')`
- Line 12: `icl_pro_translation_completed(6646)`
These lines suggest that the error is related to product IDs 6650, 6340, and 6646 in the context of product synchronization, translation, and completion.
Can you check one of these see if these are also valid? Perhaps they ended up in the same state as the one we had before, thereby preventing translation.
We wanted to bulk translate these IDs via "translation management". As soon as I did a "resave" of the products in the default language, it helped. However, we would like to figure out why it makes errors, because we want to translate in bulk.
Could you try translating multiple products at once via "Translation Management"?
Languages: English (English )German (Deutsch )French (Français )
Timezone: Europe/Zagreb (GMT+02:00)
We tried troubleshooting steps in WPML but as these didn't resolve the issue due to corrupt data in product originals, saving the products in their original form is likely necessary to correct this and the only way to find out which are these, we need new logs again.
You can try bulk editing products in WordPress also as that may fix corrupted data though:
1. Go to **Products > All Products** in the dashboard.
2. Select products, choose **Edit** from **Bulk Actions**, then **Apply**.
3. Edit the required fields in bulk.