- Statut
- Résolu
- Signalé pour
- WPML Multilingual CMS 4.6.12
- Résolu dans
- WPML 4.7
- Extension/thème associé
- Divi
- Étiquettes de sujet
- Compatibility
Aperçu de l’anomalie
Vous pouvez rencontrer un problème où les pages ne sont pas marquées comme traduites après avoir terminé la traduction à 100 % en utilisant WPML avec le thème Divi. De plus, l’erreur suivante peut être enregistrée :
PHP Fatal error: Uncaught TypeError: htmlspecialchars_decode(): Argument #1 ($string) must be of type string, array given in .../wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Shared/st/strategy/shortcode/class-wpml-pb-update-shortcodes-in-content.php:203
Solution de contournement
Veuillez vous assurer d’avoir une sauvegarde complète de votre site avant de continuer.
- Ouvrez le fichier …/wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Shared/st/strategy/shortcode/class-wpml-pb-update-shortcodes-in-content.php.
- Cherchez la ligne 206.
- Remplacez :
if ( 'allow_html_tags' !== $encoding ) { $translation = htmlspecialchars( htmlspecialchars_decode( $translation ) ); } - Par :
// Ensure $translation is a string if (is_array($translation)) { // Handle array to string conversion as needed $translation = implode('', $translation); } if ( 'allow_html_tags' !== $encoding ) { $translation = htmlspecialchars( htmlspecialchars_decode( $translation ) ); }