Übersicht über das Problem
Möglicherweise tritt ein Problem auf, bei dem Seiten nicht als übersetzt markiert werden, nachdem die Übersetzung mit WPML und dem Divi-Theme zu 100 % abgeschlossen wurde. Zusätzlich kann der folgende Fehler protokolliert werden:
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
Problemumgehung
Dieses Problem ist in WPML 4.7 behoben. Ein Update behebt dies auf Ihrer Website, daher benötigen Sie diese Problemumgehung nur, wenn Sie noch nicht aktualisieren können.
Bitte stellen Sie sicher, dass Sie ein vollständiges Website-Backup haben, bevor Sie fortfahren.
- Öffnen Sie die Datei …/wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Shared/st/strategy/shortcode/class-wpml-pb-update-shortcodes-in-content.php.
- Suchen Sie nach Zeile 206.
- Ersetzen Sie:
PHP
if ( 'allow_html_tags' !== $encoding ) { $translation = htmlspecialchars( htmlspecialchars_decode( $translation ) ); }
- Durch:
PHP
// 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 ) ); }