Vai al contenuto Vai alla barra laterale

Questo è il forum di assistenza tecnica di WPML, il plug-in multilingue di WordPress.

La sua lettura è permessa a tutti, ma la pubblicazione è riservata esclusivamente ai clienti di WPML. Il team di WPML risponde sul forum 6 giorni su 7, 22 ore su 24.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 14:00 9:00 – 14:00 9:00 – 14:00 9:00 – 14:00 9:00 – 14:00 -
- 15:00 – 18:00 15:00 – 18:00 15:00 – 18:00 15:00 – 18:00 15:00 – 18:00 -

Fuso orario del supporto: Asia/Dhaka (GMT+06:00)

Questo ticket contiene 5 risposte, ha 1 voce.

Ultimo aggiornamento da jemalG 20 ora, 41 minuto fa.

Assistito da: Prosenjit Barman.

Autore Post
Gennaio 7, 2026 alle 8:13 am #17708443

jemalG

Hello WPML Support,

I am experiencing a critical Fatal Error when trying to save or update a product in WooCommerce. The issue seems to be related to the woocommerce-multilingual plugin during the synchronization process.

Symptoms: When I click "Update" or "Publish" on a product, the site crashes with the following error.

Error Log:

Fatal error: Uncaught Error: Array callback must have exactly two elements in /var/www/webroot/ROOT/wp-content/plugins/woocommerce-multilingual/classes/Synchronization/Component/Post.php:69
Stack trace:
#0 /var/www/webroot/ROOT/wp-content/plugins/woocommerce-multilingual/classes/Synchronization/Component/Post.php(50): WCML\Synchronization\Component\Post->managePostParent()
#1 /var/www/webroot/ROOT/wp-content/plugins/woocommerce-multilingual/classes/Synchronization/Manager.php(159): WCML\Synchronization\Component\Post->run()
... [rest of the stack trace]

Gennaio 7, 2026 alle 9:20 am #17708744

jemalG

I have important additional information regarding the Fatal Error Array callback must have exactly two elements.

The error only occurs when an external plugin updates a custom field via API. We use a plugin called "Sirio WooSync" (connected to our ERP) that updates a specific custom field for Price Lists.

The Workflow causing the crash:

The ERP triggers an API update for a custom price field on a product.

WooCommerce Multilingual tries to sync this change (managePostParent runs).

The Fatal Error happens immediately, blocking the update.

Environment:

PHP: 8.3.24 (LiteSpeed)

WooCommerce: 10.4.3

WCML: 5.5.3.1

External Plugin: Sirio WooSync v1.1.0

It seems WCML fails to handle the synchronization hook triggered by this specific API update under PHP 8.3 rules. Can you verify if WCML\Synchronization\Component\Post.php can be patched to handle this type of external update safely?

Gennaio 7, 2026 alle 10:54 am #17709097

Prosenjit Barman
Sostenitore di WPML dal 03/2023

Lingue: Inglese (English )

Fuso orario: Asia/Dhaka (GMT+06:00)

Hello Jemal,

Thanks for reaching out to WPML Support. I'm Prosenjit from the WPML Development Team, and I'll be happy to help you with this issue.

I understand the problem and appreciate you providing such detailed information — it's very helpful for the investigation.

Since you have a custom setup for updating products via API, I've conducted a preliminary code review based on the stack trace and the specific line where the error occurs. Here's what I found:

At the line where the fatal error is triggered, the code is trying to call `$translationsLanguages` as a function using `$translationsLanguages($translationID)`. However, according to the method signature, `$translationsLanguages` is actually defined as an array parameter (`array<int, string> $translationsLanguages`), not a callable function.

PHP 8.3 has stricter validation for array callbacks. When PHP encounters `$translationsLanguages($translationID)`, it interprets this as an attempt to use an array as a callback function. Since the array doesn't have exactly two elements in the expected callback format, it triggers the fatal error: "Array callback must have exactly two elements."

Based on this preliminary investigation, the issue appears to be in how the code is calling this parameter. Given the method signature, could you please try updating the code as shown below and see if it resolves the issue?

- Go to /wp-content/plugins/woocommerce-multilingual/classes/Synchronization/Component/, open Post.php and scroll to the line 69
- Replace the entire line with the following code:

$translationLanguage = $translationsLanguages[ $translationID ];

Important: Please make sure to take a full backup of your site before making any code changes.

Please test the code update and let me know the results:

- If the fix works: I'll escalate this internally and work to include the fix in the next WPML update so it's available for everyone.

- If the issue persists: Please reach out, and I'll be happy to conduct a deeper investigation. Given the complexity of your custom API setup, there may be additional factors at play that we'll need to examine more closely.

Either way, I'm here to help ensure this gets fully resolved for you.

Looking forward to hearing how it goes!

Best regards,
Prosenjit

Gennaio 7, 2026 alle 1:09 pm #17709543

jemalG

Hi, for my version i dont see these /Synchronization/Component/ in classes,

I tried to download the manual version of the plugin, but I cannot find that folder.

Gennaio 8, 2026 alle 3:39 am #17711139

Prosenjit Barman
Sostenitore di WPML dal 03/2023

Lingue: Inglese (English )

Fuso orario: Asia/Dhaka (GMT+06:00)

Hi!

Thank you for checking and getting back to me.

I've just verified the same version you're using (5.5.3.1), and I can confirm that the folder structure does exist in that version. Additionally, since the stack trace explicitly shows this file path and filename in the error message, the file must be present in your installation — the error couldn't reference it otherwise.

Could you please access your site's file system using either FTP or your hosting control panel's File Manager and then check again?

Path: `wp-content/plugins/woocommerce-multilingual/classes/Synchronization/Component/`
File: `Post.php`

If you find that the file is indeed missing, I'd recommend:
1. Taking a complete backup of your site first
2. Deactivating and deleting the WooCommerce Multilingual plugin
3. Reinstalling it fresh from your WPML account

However, before we proceed with any of these steps, please let me know what you find when you check the file system. This will help us determine the best course of action.

Let me know, please! I'm here to guide you through each step if needed!

Best regards,
Prosenjit

Gennaio 12, 2026 alle 6:51 am #17720083

jemalG

Good morning, unfortunately the change made has not had any effect. Any other solutions?