- 상태
- 해결됨
- 보고된 제품
- 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 ) ); } - 파일을 저장하고 서버에 업로드하세요