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
- 11:00 – 15:00 11:00 – 15:00 11:00 – 15:00 11:00 – 15:00 11:00 – 15:00 -
- 16:00 – 20:00 16:00 – 20:00 16:00 – 20:00 16:00 – 20:00 16:00 – 20:00 -

Fuso orario del supporto: Europe/Rome (GMT+02:00)

Etichettato: 

Questo ticket contiene 28 risposte, ha 0 voices.

Ultimo aggiornamento da Laura 2 giorno, 6 ora fa.

Assistito da: Laura.

Autore Post
Settembre 8, 2025 alle 1:36 pm #17383773

antonioT-16

Contesto del problema:
Sto cercando di risolvere gli errori che sono apparsi nel file di log del server dopo aver installato WPML. Gli errori sembrano essere legati a query SQL che coinvolgono la tabella 'icl_t'.

Sintomi:
Errori nel file di log del server che indicano 'WordPress database error Not unique table/alias: 'icl_t' for query SELECT t.term_id'.

Domande:
Potete aiutarmi a capire di che cosa si tratta?
Come posso risolvere questi errori?

Settembre 8, 2025 alle 3:12 pm #17384178

Laura
Sostenitore di WPML dal 05/2018

Lingue: Inglese (English ) Italiano (Italiano )

Fuso orario: Europe/Rome (GMT+02:00)

Salve,

grazie per averci contattato.

Sembrerebbe che l'installazione sia corrotta. Se non hai ancora effettuato traduzioni ti suggerirei di fare un reset di WPML e vedere se così risolvi.

Settembre 9, 2025 alle 2:11 pm #17387465

antonioT-16

Buon pomeriggio Laura, purtroppo, anche dopo il reset, l'errore risulta ancora. Te lo copio-incollo di seguito e attendo istruzioni. Grazie mille.

2025/09/09 15:10:03 [error] 2978027#2978027: *419743 FastCGI sent in stderr: "PHP message: WordPress database error Not unique table/alias: 'icl_t' for query SELECT t.term_id
FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON t.term_id = tt.term_id LEFT JOIN wp_icl_translations icl_t
ON icl_t.element_id = tt.term_taxonomy_id
AND icl_t.element_type IN ('tax_product_cat') LEFT JOIN wp_icl_translations icl_t
ON icl_t.element_id = tt.term_taxonomy_id
AND icl_t.element_type IN ('tax_product_cat')
WHERE tt.taxonomy IN ('product_cat') AND tt.parent = '17' AND ( ( icl_t.element_type IN ('tax_product_cat') AND ( icl_t.language_code = 'it' OR 0 ) )
OR icl_t.element_type NOT IN ('tax_product_cat') OR icl_t.element_type IS NULL ) AND ( ( icl_t.element_type IN ('tax_product_cat') AND ( icl_t.language_code = 'it' OR 0 ) )
OR icl_t.element_type NOT ...; PHP message: WordPress database error Not unique table/alias: 'icl_t' for query SELECT t.term_id
FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON t.term_id = tt.term_id LEFT JOIN wp_icl_translations icl_t
ON icl_t.element_id = tt.term_taxonomy_id
AND icl_t.element_type IN ('tax_product_cat') LEFT JOIN wp_icl_translations icl_t
ON icl_t.element_id = tt.term_taxonomy_id
AND icl_t.element_type IN ('tax_product_cat')
WHERE tt.taxonomy IN ('product_cat') AND tt.parent = '23' AND ( ( icl_t.element_type IN ('tax_product_cat') AND ( icl_t.language_code = 'it' OR 0 ) )
OR icl_t.element_type NOT IN ('tax_product_cat') OR icl_t.element_type IS NULL ) AND ( ( icl_t.element_type IN ('tax_product_cat') AND ( icl_t.language_code = 'it' OR 0 ) )

2025/09/09 15:10:03 [error] 2978027#2978027: *419743 FastCGI sent in stderr: " table/alias: 'icl_t' for query SELECT t.term_id
FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON t.term_id = tt.term_id LEFT JOIN wp_icl_translations icl_t
ON icl_t.element_id = tt.term_taxonomy_id
AND icl_t.element_type IN ('tax_product_cat') LEFT JOIN wp_icl_translations icl_t
ON icl_t.element_id = tt.term_taxonomy_id
AND icl_t.element_type IN ('tax_product_cat')
WHERE tt.taxonomy IN ('product_cat') AND tt.parent = '33' AND ( ( icl_t.element_type IN ('tax_product_cat') AND ( icl_t.language_code = 'it' OR 0 ) )
OR icl_t.element_type NOT IN ('tax_product_cat') OR icl_t.element_type IS NULL ) AND ( ( icl_t.element_type IN ('tax_product_cat') AND ( icl_t.language_code = 'it' OR 0 ) )
OR icl_t.element_type NOT ...; PHP message: WordPress database error Not unique table/alias: 'icl_t' for query SELECT t.term_id
FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON t.term_id = tt.term_id LEFT JOIN wp_icl_translations icl_t
ON icl_t.element_id = tt.term_taxonomy_id
AND icl_t.element_type IN ('tax_product_cat') LEFT JOIN wp_icl_translations icl_t
ON icl_t.element_id = tt.term_taxonomy_id
AND icl_t.element_type IN ('tax_product_cat')
WHERE tt.taxonomy IN ('product_cat') AND tt.parent = '42' AND ( ( icl_t.element_type IN ('tax_product_cat') AND ( icl_t.language_code = 'it' OR 0 ) )
OR icl_t.element_type NOT IN ('tax_product_cat') OR icl_t.element_type IS NULL ) AND ( ( icl_t.element_type IN ('tax_product_cat') AND ( icl_t.language_code = 'it' OR 0 ) )
OR icl_t.eleme
2025/09/09 15:10:03 [error] 2978027#2978027: *419743 FastCGI sent in stderr: "d
FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON t.term_id = tt.term_id LEFT JOIN wp_icl_translations icl_t
ON icl_t.element_id = tt.term_taxonomy_id
AND icl_t.element_type IN ('tax_product_cat') LEFT JOIN wp_icl_translations icl_t
ON icl_t.element_id = tt.term_taxonomy_id
AND icl_t.element_type IN ('tax_product_cat')
WHERE tt.taxonomy IN ('product_cat') AND tt.parent = '45' AND ( ( icl_t.element_type IN ('tax_product_cat') AND ( icl_t.language_code = 'it' OR 0 ) )
OR icl_t.element_type NOT IN ('tax_product_cat') OR icl_t.element_type IS NULL ) AND ( ( icl_t.element_type IN ('tax_product_cat') AND ( icl_t.language_code = 'it' OR 0 ) )
OR icl_t.element_type NOT ...; PHP message: WordPress database error Not unique table/alias: 'icl_t' for query SELECT t.term_id
FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON t.term_id = tt.term_id LEFT JOIN wp_icl_translations icl_t
ON icl_t.element_id = tt.term_taxonomy_id
AND icl_t.element_type IN ('tax_product_cat') LEFT JOIN wp_icl_translations icl_t
ON icl_t.element_id = tt.term_taxonomy_id
AND icl_t.element_type IN ('tax_product_cat')
WHERE tt.taxonomy IN ('product_cat') AND tt.parent = '30' AND ( ( icl_t.element_type IN ('tax_product_cat') AND ( icl_t.language_code = 'it' OR 0 ) )
OR icl_t.element_type NOT IN ('tax_product_cat') OR icl_t.element_type IS NULL ) AND ( ( icl_t.element_type IN ('tax_product_cat') AND ( icl_t.language_code = 'it' OR 0 ) )
OR icl_t.element_type NOT ...; PHP message: WordPress database

Settembre 9, 2025 alle 4:44 pm #17388146

Laura
Sostenitore di WPML dal 05/2018

Lingue: Inglese (English ) Italiano (Italiano )

Fuso orario: Europe/Rome (GMT+02:00)

Prova a disattivare tutti i plugin tranne WooCommerce e quelli di WPML e passa ad un tema di default per vedere se è uno di questi a causare l'errore.

Settembre 10, 2025 alle 8:13 am #17389420

antonioT-16

Buongiorno Laura,
il sito è in produzione per cui purtroppo non posso fare quel tipo di test. Però ti fornisco un altro elemento che potrebbe aiutare a capire il problema. Stamattina il sito ha restituito l'errore che ti incollo di seguito (mi è arrivata la mail di WordPress relativa al problema tecnico).
Si fa riferimento alla riga 657 del file "wpml-term-translations.class.php"

When seeking help with this issue, you may be asked for some of the following information:
Versione di WordPress 6.8.1
Tema attivo: Pro – Child Theme (versione 1.0.0) Plugin corrente: WPML Multilingual CMS (versione 4.8.1) Versione PHP 8.3.23

Dettagli dell'errore
====================
Un errore di E_ERROR è stato causato nella linea 657 del file /var/datahd/websites/look4hair.com/wp-content/plugins/sitepress-multilingual-cms/inc/taxonomy-term-translation/wpml-term-translations.class.php. Messaggio di errore: Uncaught Error: Cannot use object of type WP_Error as array in /var/datahd/websites/look4hair.com/wp-content/plugins/sitepress-multilingual-cms/inc/taxonomy-term-translation/wpml-term-translations.class.php:657
Stack trace:
#0 /var/datahd/websites/look4hair.com/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Logic.php(63): WPML_Terms_Translations::{closure}()
#1 [internal function]: WPML\FP\Logic::WPML\FP\{closure}()
#2 /var/datahd/websites/look4hair.com/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/functions.php(154): call_user_func_array()
#3 [internal function]: WPML\FP\{closure}()
#4 /var/datahd/websites/look4hair.com/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/collect/src/Illuminate/Support/Collection.php(603): array_map()
#5 /var/datahd/websites/look4hair.com/wp-content/plugins/sitepress-multilingual-cms/inc/taxonomy-term-translation/wpml-term-translations.class.php(574): WPML\Collect\Support\Collection->map()
#6 /var/datahd/websites/look4hair.com/wp-content/plugins/sitepress-multilingual-cms/inc/taxonomy-term-translation/wpml-term-translations.class.php(524): WPML_Terms_Translations::quick_edited_post_terms()
#7 /var/datahd/websites/look4hair.com/wp-content/plugins/sitepress-multilingual-cms/inc/taxonomy-term-translation/wpml-term-translations.class.php(502): WPML_Terms_Translations::set_tags_in_proper_language()
#8 /var/datahd/websites/look4hair.com/wp-includes/class-wp-hook.php(324): WPML_Terms_Translations::set_object_terms_action()
#9 /var/datahd/websites/look4hair.com/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
#10 /var/datahd/websites/look4hair.com/wp-includes/plugin.php(517): WP_Hook->do_action()
#11 /var/datahd/websites/look4hair.com/wp-includes/taxonomy.php(2966): do_action()
#12 /var/datahd/websites/look4hair.com/wp-includes/post.php(5654): wp_set_object_terms()
#13 /var/datahd/websites/look4hair.com/wp-content/plugins/sitepress-multilingual-cms/inc/actions/wpml-tm-post-actions.class.php(243): wp_set_post_terms()
#14 /var/datahd/websites/look4hair.com/wp-content/plugins/sitepress-multilingual-cms/inc/actions/wpml-tm-post-actions.class.php(52): WPML_TM_Post_Actions->save_translation_priority()
#15 /var/datahd/websites/look4hair.com/wp-content/plugins/sitepress-multilingual-cms/inc/functions-load-tm.php(941): WPML_TM_Post_Actions->save_post_actions()
#16 /var/datahd/websites/look4hair.com/wp-includes/class-wp-hook.php(324): wpml_tm_save_post()
#17 /var/datahd/websites/look4hair.com/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
#18 /var/datahd/websites/look4hair.com/wp-includes/plugin.php(517): WP_Hook->do_action()
#19 /var/datahd/websites/look4hair.com/wp-content/plugins/sitepress-multilingual-cms/inc/post-translation/wpml-post-translation.class.php(213): do_action()
#20 /var/datahd/websites/look4hair.com/wp-content/plugins/sitepress-multilingual-cms/inc/post-translation/wpml-admin-post-actions.class.php(123): WPML_Post_Translation->after_save_post()
#21 /var/datahd/websites/look4hair.com/wp-includes/class-wp-hook.php(326): WPML_Admin_Post_Actions->save_post_actions()
#22 /var/datahd/websites/look4hair.com/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
#23 /var/datahd/websites/look4hair.com/wp-includes/plugin.php(517): WP_Hook->do_action()
#24 /var/datahd/websites/look4hair.com/wp-includes/post.php(5110): do_action()
#25 /var/datahd/websites/look4hair.com/wp-includes/post.php(5212): wp_insert_post()
#26 /var/datahd/websites/look4hair.com/wp-admin/includes/post.php(453): wp_update_post()
#27 /var/datahd/websites/look4hair.com/wp-admin/post.php(227): edit_post()
#28 {main}
thrown

Settembre 10, 2025 alle 10:04 am #17390033

Laura
Sostenitore di WPML dal 05/2018

Lingue: Inglese (English ) Italiano (Italiano )

Fuso orario: Europe/Rome (GMT+02:00)

Potrebbero essere collegati, ma senza fare test non è possibile dire nient'altro. Non è possibile creare uno staging?

Settembre 11, 2025 alle 9:22 am #17393351

antonioT-16

Buongiorno Laura,
purtroppo abbiamo difficoltà nel creare una staging area; cercando di capire da cosa possa dipendere ho visto che il trigger che scatena l'errore è nel file /wp-content/plugins/sitepress-multilingual-cms/inc/taxonomy-term-translation/wpml-term-translations.class.php in corrispondenza di questa funzione:

private static function createTerm( $taxonomy, $postLang ) {
return function ( $termData ) use ( $taxonomy, $postLang ) {
global $sitepress;

$idInCorrectId = false;
$newTerm = wp_insert_term( $termData['name'], $taxonomy, [ 'slug' => self::term_unique_slug( sanitize_title( $termData['name'] ), $taxonomy, $postLang ) ] );
if ( isset( $newTerm['term_taxonomy_id'] ) ) {
$idInCorrectId = $newTerm['term_taxonomy_id'];
$trid = $sitepress->get_element_trid( $termData['id'], 'tax_' . $taxonomy );
$sitepress->set_element_language_details( $idInCorrectId, 'tax_' . $taxonomy, $trid, $postLang );
}

return Obj::assoc( 'idInPostLang', $idInCorrectId, $termData );
};
}

Nello specifico la riga:

if ( isset( $newTerm['term_taxonomy_id'] ) ) {

Questa info potrebbe essere d'aiuto?

Settembre 11, 2025 alle 9:45 am #17393503

Laura
Sostenitore di WPML dal 05/2018

Lingue: Inglese (English ) Italiano (Italiano )

Fuso orario: Europe/Rome (GMT+02:00)

No, perché il problema è sul database, senza mettere le mani sul database non abbiamo riscontro dell'errore. Se non è possibile avere uno staging mi serve una copia del sito.

Settembre 15, 2025 alle 11:36 am #17401909

antonioT-16

Buongiorno Laura, dove posso inviarti copia del sito? Via WeTransfer?
Grazie

Settembre 15, 2025 alle 1:51 pm #17402717

Laura
Sostenitore di WPML dal 05/2018

Lingue: Inglese (English ) Italiano (Italiano )

Fuso orario: Europe/Rome (GMT+02:00)

Sì, WeTransfer va bene. Per favore usa Duplicator o WP All In one Migration

Settembre 15, 2025 alle 3:17 pm #17403217

antonioT-16

Buon pomeriggio Laura,
ho esportato database e files e sono pronto ad inviarti il we transfer; Dato che il ticket è pubblico, come posso fare per inoltrarti il link?

Ti ringrazio

Settembre 15, 2025 alle 3:25 pm #17403256

Laura
Sostenitore di WPML dal 05/2018

Lingue: Inglese (English ) Italiano (Italiano )

Fuso orario: Europe/Rome (GMT+02:00)

Il ticket è pubblico ma i link sono visibili solo all'autore del ticket e ai supporter, quindi mettilo pure qui.

Settembre 16, 2025 alle 9:30 am #17405356

antonioT-16

link nascosto

Settembre 16, 2025 alle 5:36 pm #17407444

Laura
Sostenitore di WPML dal 05/2018

Lingue: Inglese (English ) Italiano (Italiano )

Fuso orario: Europe/Rome (GMT+02:00)

Per favore usa Duplicator o WP All in One Migration, devo copiare il sito su un server di test e farlo a partire dai file è molto macchinoso.

Settembre 17, 2025 alle 8:32 am #17408476

antonioT-16

Ok. Sto rieseguendo la copia tramite WP All in One Migration. Dato la copia pesa oltre 5 GB, avrei bisogno di una mail per poter condividere il link da Google Drive.

Grazie