ここの情報は古いです。ご理解頂いた上でお取り扱いください。

Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#1610 closed defect (fixed)

ext_includeのエラーログにテンプレートパスが含まれていない

Reported by: kiwa Owned by: ebihara
Priority: major Milestone: OpenPNE2.10.2
Component: その他 Version: 2.8.x & 2.10.x & 2.11.x
Keywords: OpenPNE2.8.7 OpenPNE2.11.2 Cc:

Description (last modified by ebihara)

■現象

Smartyプラグインの ext_include で読み込まれるテンプレートが存在しなかった場合に表示されるエラーに、そのテンプレートのパスが含まれていない。

■原因

エラー出力部分の記述ミス。以下のコードでは $tpl は存在しないのにもかかわらず、 $tpl を出力しようとしている。

    // 拡張ファイルチェック
    if (!$tpl = $smarty->ext_search($template, $place)) {
        $smarty->trigger_error('ext_include: tpl file not found. ' . $template);
        return;
    }

■修正内容

エラーメッセージを出力する際に、 $tpl ではなく $template を用いる。

$smarty->trigger_error('ext_include: tpl file not found. ' . $template);

修正リビジョンは以下

■関連情報

http://sns.openpne.jp/?m=pc&a=page_fh_diary&target_c_diary_id=14424 より転記

function.ext_include.phpを見ると

if (!$tpl = $smarty->ext_search($template, $place)) {
    $smarty->trigger_error('ext_include: tpl file not found. '.$tpl);
    return;
}

となっているが、テンプレートファイルが見つからなかったとき、$tplは空なので、エラーメッセージには何のテンプレートが見つからなかったのかが出力されない。
少なくとも、

if (!$tpl = $smarty->ext_search($template, $place)) {
    $smarty->trigger_error('ext_include: tpl file not found. '.$template);
    return;
}

としないと目的を果たせない。

Change History (13)

comment:1 Changed 15 years ago by kiwa

Keywords: 再現待ち removed

comment:2 Changed 15 years ago by kiwa

Priority: minormajor

comment:3 Changed 15 years ago by kiwa

Milestone: OpenPNE2.10.2

comment:4 Changed 15 years ago by kiwa

Keywords: OpenPNE2.8.7 added

comment:5 Changed 15 years ago by ogawa

Description: modified (diff)
Summary: ext_includeのエラー出力ミスext_includeのエラーログにテンプレートパスが含まれていない

comment:6 Changed 15 years ago by ebihara

Owner: changed from nobody to ebihara
Status: newassigned

やります

comment:7 Changed 15 years ago by ebihara

Description: modified (diff)

以下のリビジョンで修正しました。ご確認ください。

Descriptionの「■現象」「■原因」「■修正内容」を更新しました。

comment:8 Changed 15 years ago by ebihara

Description: modified (diff)
Keywords: 確認中 added
Owner: changed from ebihara to ogawa
Status: assignednew

2.8.xへの修正を忘れていました。r4675で対処しました。

ご確認ください。

comment:9 Changed 15 years ago by ogawa

Keywords: 確認中 removed
Owner: changed from ogawa to ebihara

comment:10 Changed 15 years ago by ogawa

Resolution: fixed
Status: newclosed

comment:11 Changed 15 years ago by kiwa

Keywords: テスト待ち added
Resolution: fixed
Status: closedreopened

動作テストが終わってないのでテスト待ちに変更します

comment:12 Changed 15 years ago by kiwa

Keywords: テスト待ち removed
Resolution: fixed
Status: reopenedclosed

comment:13 Changed 15 years ago by kiwa

Keywords: OpenPNE2.11.2 added
Note: See TracTickets for help on using tickets.