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. ファイルを保存し、サーバーにアップロードします。

すべての既知の問題 →