LoginSignup
0
0

More than 5 years have passed since last update.

エックスサーバー(Xserver)でMovable Typeの公開予約を利用すると大量のエラーが出る問題の対処

Posted at

エックスサーバー(Xserver)の比較的新しいサーバーで、Movable Type6の「公開キュー」を利用して記事の公開予約をすると、チェック用のメールアドレスに、以下のようなエラーが大量に送信されることがあります。

公開処理自体は正しく行われているようです。

Use of uninitialized value in numeric gt (>) at /home/path/to/mt/tools/../lib/MT/Template/Tags/Asset.pm line 1179.
libpng warning: Interlace handling should be turned on when using png_read_image

それぞれに対する対応についてまとめます。

Use of uninitialized value in numeric... について

Perlの文法チェックが厳格になったことによるエラーです。数値比較を行う場合、必ず初期値を指定する必要があるようです。

予約投稿時にPerlの文法エラーが表示される - MTQ | Movable Type ユーザーコミュニティ
http://communities.movabletype.jp/2017/11/perl-2.html

Movable Typeコアの、以下のファイルをテキストエディタで開き
/lib/MT/Template/Tags/Asset.pm
の、1177行目付近にある、以下のコードを探してください。

mt6_Asset.pm
    if ( !$args->{force} ) {
        delete $arg{Width}  if $arg{Width} > $a->image_width;
        delete $arg{Height} if $arg{Height} > $a->image_height;
    }

これをコメントアウトして、以下の通り修正してください。

mt6_Asset_editted.pm
#    if ( !$args->{force} ) {
#        delete $arg{Width}  if $arg{Width} > $a->image_width;
#        delete $arg{Height} if $arg{Height} > $a->image_height;
#    }

    if ( !$args->{force} ) {
        delete $arg{Width}  if (defined($arg{Width}) && $arg{Width} > $a->image_width);
        delete $arg{Height} if (defined($arg{Height}) && $arg{Height} > $a->image_height);
    }

libpng warning: Interlace handling... について

Movable Typeの画像ライブラリをGDに変更していると発生するようです。

下記の記事の通り、ライブラリをGD以外に変更すると発生しなくなりますが…

エックスサーバー(Xserver)でMovable Typeに画像をアップロードできない場合の対処
https://qiita.com/webbingstudio@github/items/c374a4856411f48d7a2c

いくつかのプラグインで大量の文法エラーが出るようになってしまいます。
私の環境では、以下でエラーを確認しています。

  • GetQueryParam(MailFormの関連プラグイン)
  • PageBute
Argument "" isn't numeric in numeric eq (==) at /path/to/mt/plugins/GetQueryParam/GetQueryParam.pl line 213.
Use of uninitialized value $value_str[0] in numeric eq (==) at /path/to/mt/plugins/GetQueryParam/GetQueryParam.pl line 213.
Use of uninitialized value $value_str[1] in string eq at /path/to/mt/plugins/GetQueryParam/GetQueryParam.pl line 213.
Argument "" isn't numeric in numeric eq (==) at /path/to/mt/plugins/GetQueryParam/GetQueryParam.pl line 213.
Argument "\x{4ed5}\x{4e8b}..." isn't numeric in numeric eq (==) at /path/to/mt/plugins/GetQueryParam/GetQueryParam.pl line 213.

・・・

Use of uninitialized value in join or string at /path/to/mt/plugins/GetQueryParam/GetQueryParam.pl line 260.
Use of uninitialized value in numeric eq (==) at /path/to/mt/plugins/MailForm/MailForm.pl line 366.
・・・

Use of uninitialized value in concatenation (.) or string at /path/to/mt/plugins/PageBute.pl line 500.
Use of uninitialized value in concatenation (.) or string at /path/to/mt/plugins/PageBute.pl line 506.
Use of uninitialized value $delim in concatenation (.) or string at /path/to/mt/plugins/PageBute.pl line 499.
Use of uninitialized value in concatenation (.) or string at /path/to/mt/plugins/PageBute.pl line 500.
Use of uninitialized value in concatenation (.) or string at /path/to/mt/plugins/PageBute.pl line 506.
・・・

結論

ライブラリをGD以外にする対応は難しいため、「Use of uninitialized value in numeric...」エラーだけを修正し、Cronのメール通知を停止するしか、現状は回避策がないようです。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0