WPML
สถานะ
แก้ไขแล้ว
รายงานสำหรับ
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 ข้างต้นจะปรากฏในหน้าจัดการเว็บไซต์ของคุณ เช่น หน้าปลั๊กอิน ธีม หรือหน้า การจัดการการแปล > การตั้งค่าเนื้อหาหลายภาษา

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

  1. เข้าสู่ระบบผ่าน FTP
  2. ค้นหาไฟล์ sitepress-multilingual-cms/inc/wpml-config/wpml-config.class.php
  3. ค้นหาบรรทัดที่ระบุไว้ในข้อผิดพลาด PHP ที่คุณพบ (252) ตัวอย่างเช่น: 581480-Schermata_2015_03_18_alle_20.43.56
    $type = ( dirname( $file ) == get_template_directory() || dirname( $file ) == get_stylesheet_directory() ) ? 'theme' : 'plugin';
    $admin_text_context = basename( dirname( $file ) );
  4. ลบโค้ดทั้งสองบรรทัด
  5. ในไฟล์เดียวกัน ให้ค้นหาโค้ดต่อไปนี้ (ประมาณบรรทัดที่ 210):
    }else{
     $config = icl_xml2array( file_get_contents( $file ) );
    }
  6. แก้ไขบล็อกโค้ดนี้ให้เป็น:
    }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 ) );
    }
  7. บันทึกไฟล์และอัปโหลดไปยังเซิร์ฟเวอร์ของคุณ

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