WPML
Status
Resolvido
Relatado para
WPML Multilingual CMS 4.6.12
Resolvido em
WPML 4.7
Plugin/tema relacionado
Divi
Tags de tópico
Compatibility

Visão geral do problema

Você pode encontrar um problema em que as páginas não são marcadas como traduzidas após concluir a tradução em 100% usando o WPML com o tema Divi. Além disso, o seguinte erro pode ser registrado:

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

Solução alternativa

Por favor, certifique-se de ter um backup completo do seu site antes de prosseguir.


  • Abra o arquivo …/wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Shared/st/strategy/shortcode/class-wpml-pb-update-shortcodes-in-content.php.

  • Procure a linha 206.

  • Substitua:
    		if ( 'allow_html_tags' !== $encoding ) {
    			$translation = htmlspecialchars( htmlspecialchars_decode( $translation ) );
    		}


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

Todos os problemas conhecidos →