Problem: If you're trying to switch languages on a profile page using the WPML language switcher, but instead of being redirected to the corresponding profile page in the other language, you are redirected to a generic profile page or a warning page. Solution: We recommend backing up your site before making any changes. Then, edit your theme's functions.php file and add the following code at the end:
// WPML Workaround for compsupp-8195<br />// Preserve WPUM profile sub-path when switching languages with WPML.<br />add_filter( 'icl_ls_languages', function( $languages ) {<br /> // Only run if WPUM<br /> if ( ! function_exists( 'wpum_get_core_page_id' ) ) {<br /> return $languages;<br /> }<br /><br /> // Get profile info from query vars<br /> $queried_profile = get_query_var( 'profile', false );<br /> if ( ! $queried_profile ) {<br /> return $languages;<br /> }<br /><br /> // Build the trailing path from query vars<br /> $trailing = '/' . rawurlencode( $queried_profile );<br /><br /> // Add tab and pagination if present<br /> $tab = get_query_var( 'tab' );<br /> if ( $tab ) {<br /> $trailing .= '/' . rawurlencode( $tab );<br /> }<br /> $paged = get_query_var( 'paged' );<br /> if ( $paged ) {<br /> $trailing .= '/page/' . rawurlencode( $paged );<br /> }<br /><br /> // Append to each language URL<br /> foreach ( $languages as $key => $lang ) {<br /> if ( empty( $lang['url'] ) ) {<br /> continue;<br /> }<br /> $languages[$key]['url'] = rtrim( $lang['url'], '/' ) + $trailing;<br /> }<br /><br /> return $languages;<br />} );
This solution might be outdated or not applicable to your 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 this does not resolve your issue, please open a new support ticket.
Problema: Se stai cercando di visualizzare i media nella Media Library e non riesci a vedere la lista dei media caricati, potresti riscontrare un errore di tipo 'Fatal error: Uncaught InvalidArgumentException'. Questo può indicare che le tabelle del database di WPML potrebbero essere danneggiate o che manca un autoincrement in qualche ID, spesso a seguito di una migrazione o di un'azione simile.
Soluzione: Per risolvere questo problema, abbiamo verificato e corretto la configurazione del database. Specificamente, abbiamo rilevato che nella tabella
icl_translations
c'era un record con Translation ID impostato su 0 e la colonna non era configurata come AUTO_INCREMENT. Abbiamo eliminato la voce con ID 0 e impostato la chiave come AUTO_INCREMENT, permettendo così al sistema di generare automaticamente gli ID corretti. Dopo questa correzione, la visualizzazione dei media nella Media Library dovrebbe funzionare correttamente.
Se la soluzione proposta non risolve il tuo problema o sembra non essere più attuale, ti consigliamo di verificare la presenza di problemi noti correlati visitando https://wpml.org/known-issues/, verificare la versione del fix permanente e confermare che hai installato le ultime versioni dei temi e dei plugin. Se il problema persiste, ti invitiamo a aprire un nuovo ticket di supporto.