- สถานะ
- แก้ไขแล้ว
- รายงานสำหรับ
- WPML Multilingual CMS 3.1.9.3
- แก้ไขใน
- 3.1.9.4
ภาพรวมของปัญหา
Catchable fatal error: Object of class stdClass could not be converted to string in /home/lahjatup/public_html/markkinointiopisto.fi/wp-content/plugins/sitepress-multilingual-cms/inc/wpml-config/wpml-config.class.php on line 252
หรือ
Warning: dirname() expects parameter 1 to be string, object given in /home1/treasure/public_html/dev/wp-content/plugins/sitepress-multilingual-cms/inc/wpml-config/wpml-config.class.php on line 252
ข้อผิดพลาด PHP ข้างต้นจะปรากฏในหน้าจัดการเว็บไซต์ของคุณ เช่น หน้าปลั๊กอิน ธีม หรือหน้า การจัดการการแปล > การตั้งค่าเนื้อหาหลายภาษา
วิธีแก้ปัญหาชั่วคราว
- เข้าสู่ระบบผ่าน FTP
- ค้นหาไฟล์ sitepress-multilingual-cms/
inc/wpml-config/wpml-config. class.php - ค้นหาบรรทัดที่ระบุไว้ในข้อผิดพลาด PHP ที่คุณพบ (252) ตัวอย่างเช่น:
$type = ( dirname( $file ) == get_template_directory() || dirname( $file ) == get_stylesheet_directory() ) ? 'theme' : 'plugin'; $admin_text_context = basename( dirname( $file ) );
- ลบโค้ดทั้งสองบรรทัด
- ในไฟล์เดียวกัน ให้ค้นหาโค้ดต่อไปนี้ (ประมาณบรรทัดที่ 210):
}else{ $config = icl_xml2array( file_get_contents( $file ) ); } - แก้ไขบล็อกโค้ดนี้ให้เป็น:
}else{ $config = icl_xml2array( file_get_contents( $file ) ); $type = ( dirname( $file ) == get_template_directory() || dirname( $file ) == get_stylesheet_directory() ) ? 'theme' : 'plugin'; $admin_text_context = basename( dirname( $file ) ); } - บันทึกไฟล์และอัปโหลดไปยังเซิร์ฟเวอร์ของคุณ