WPML

문제 개요

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. 파일을 저장하고 서버에 업로드하세요

모든 알려진 문제

여전히 이 문제가 발생합니까?

업데이트해도 문제가 해결되지 않으면 지원 문의를 하세요. 함께 살펴보겠습니다.