WPML
สถานะ
แก้ไขแล้ว
รายงานสำหรับ
WPML Multilingual CMS 4.6.12
แก้ไขใน
WPML 4.7
ปลั๊กอิน/ธีมที่เกี่ยวข้อง
Divi
แท็กหัวข้อ
Compatibility

ภาพรวมของปัญหา

คุณอาจพบปัญหาที่หน้าเว็บไม่ถูกทำเครื่องหมายว่าแปลแล้วหลังจากทำการแปลเสร็จสมบูรณ์ 100% เมื่อใช้ WPML ร่วมกับ ธีม Divi นอกจากนี้ อาจมีการบันทึกข้อผิดพลาดต่อไปนี้:

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

วิธีแก้ปัญหาชั่วคราว

โปรดตรวจสอบให้แน่ใจว่าคุณมีข้อมูลสำรองไซต์แบบเต็มของไซต์คุณก่อนดำเนินการต่อ


  • เปิดไฟล์ …/wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Shared/st/strategy/shortcode/class-wpml-pb-update-shortcodes-in-content.php

  • ค้นหาบรรทัดที่ 206

  • แทนที่:
    		if ( 'allow_html_tags' !== $encoding ) {
    			$translation = htmlspecialchars( htmlspecialchars_decode( $translation ) );
    		}


  • ด้วย:
    		// 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 ) );
    		}

ปัญหาที่ทราบแล้วทั้งหมด →