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

すべての既知の問題

まだこの問題が発生しますか?

アップデートしても問題が解決しない場合は、サポートのご質問をお寄せください。一緒に調査いたします。