Vai al contenuto Vai alla barra laterale

Questo thread è stato risolto. Ecco una descrizione del problema e della soluzione.

Problem:
You are trying to translate a page using WPML, but you encounter a PHP fatal error. Specifically, you receive a PHP Warning: Undefined array key and a PHP Fatal error related to the array_merge function in the WPML plugin.
Solution:
The issue you are experiencing is related to a known error documented here: WPML 4.8 Fatal Error When Translating Pages Containing Images Without Metadata. We recommend updating WPML to the latest version available, which at the time of the response was 4.8.w. This update should resolve the error and allow you to translate pages without encountering the PHP fatal error.

Please note that this solution might be outdated or not applicable to your specific case. We 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 problem persists, please open a new support ticket at WPML support forum for further assistance.

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.

Etichettato: 

Questo ticket contiene 2 risposte, ha 1 voices.

Ultimo aggiornamento da gianfrancoa-3 2 settimana, 5 giorno fa.

Assistito da: Paola Mendiburu.

Autore Post
Ottobre 13, 2025 alle 4:56 pm #17480685

gianfrancoa-3

Contesto del problema:
I'm trying to translate a page using WPML, but I encountered a PHP fatal error instead.

Sintomi:
I can't translate the page. Instead, I got a fatal error: 'PHP Warning: Undefined array key 2758 in /www/wp-content/plugins/sitepress-multilingual-cms/classes/media-translation/AddMediaDataToTranslationPackage.php on line 83; PHP Fatal error: Uncaught TypeError: array_merge(): Argument #1 must be of type array, null given in /www/wp-content/plugins/sitepress-multilingual-cms/classes/media-translation/AddMediaDataToTranslationPackage.php:82'.

Domande:
Why am I getting a PHP Fatal error when trying to translate a page?
How can I resolve the PHP Warning and Fatal error related to array_merge in WPML?

Ottobre 13, 2025 alle 5:06 pm #17480718

gianfrancoa-3

Just a further note: the AI Assistant told me to edit this file:
/www/wp-content/plugins/sitepress-multilingual-cms/classes/media-translation/AddMediaDataToTranslationPackage.php

Can you please tell me if this fix is already included in latest WPML versions?
Thanks

Ottobre 14, 2025 alle 7:52 am #17482200

Paola Mendiburu
Sostenitore di WPML dal 11/2020

Lingue: Inglese (English ) Spagnolo (Español ) Italiano (Italiano )

Fuso orario: Europe/Madrid (GMT+01:00)

Ciao!

Sono Paola, spero vada tutto bene.

Il problema era legato a questa errata:
https://wpml.org/errata/wpml-4-8fatal-error-when-translating-pages-containing-images-without-metadata/

Se aggiorni WPML all’ultima versione disponibile 4.8.w, vedrai che ora tutto funziona correttamente.

Ottobre 14, 2025 alle 1:42 pm #17484272

gianfrancoa-3

Grazie, ho aggiornato all'ultima versione di WPML e adesso la traduzione della pagina funziona correttamente 🙂