- Trạng thái
- Đã giải quyết
- Được báo cáo cho
- WPML Multilingual CMS 4.6.12
- Đã giải quyết trong
- WPML 4.7
- Plugin/giao diện liên quan
- Divi
- Thẻ chủ đề
- Compatibility
Tổng quan về lỗi
Bạn có thể gặp phải sự cố các trang không được đánh dấu là đã dịch sau khi hoàn thành bản dịch 100% khi sử dụng WPML với giao diện Divi. Ngoài ra, lỗi sau có thể được ghi lại:
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
Giải pháp tạm thời
Vui lòng đảm bảo rằng bạn đã sao lưu toàn bộ trang web của mình trước khi tiếp tục.
- Mở tệp …/wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Shared/st/strategy/shortcode/class-wpml-pb-update-shortcodes-in-content.php.
- Tìm dòng 206.
- Thay thế:
if ( 'allow_html_tags' !== $encoding ) { $translation = htmlspecialchars( htmlspecialchars_decode( $translation ) ); } - Bằng:
// 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 ) ); }