WPML
Status
Gelöst
Gemeldet für
WPML Multilingual CMS 4.6.12
Gelöst in
WPML 4.7
Zugehöriges Plugin/Theme
Divi
Themen-Tags
Compatibility

Ü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

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:
    		if ( 'allow_html_tags' !== $encoding ) {
    			$translation = htmlspecialchars( htmlspecialchars_decode( $translation ) );
    		}


  • Durch:
    		// 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 ) );
    		}

Alle bekannten Probleme →