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