WPML
Trạng thái
Đã giải quyết
Được báo cáo cho
WPML Multilingual CMS 3.1.9.3
Đã giải quyết trong
3.1.9.4

Tổng quan về lỗi

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

Hoặc

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

Các lỗi PHP trên sẽ xuất hiện trong các trang quản trị của bạn như các trang plugin, giao diện hoặc Quản lý dịch thuật > Thiết lập nội dung đa ngôn ngữ.

Giải pháp tạm thời

  1. Đăng nhập qua FTP
  2. Tìm tệp sitepress-multilingual-cms/inc/wpml-config/wpml-config.class.php
  3. Tìm dòng được đề cập trong lỗi PHP mà bạn thấy (252). Ví dụ: 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. Xóa cả hai dòng mã
  5. Trong cùng tệp đó, hãy tìm mã sau (khoảng dòng 210):
    }else{
     $config = icl_xml2array( file_get_contents( $file ) );
    }
  6. Sửa đổi khối mã này thành:
    }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. Lưu tệp và tải lên máy chủ của bạn

Tất cả các lỗi đã ghi nhận →