ここの情報は古いです。ご理解頂いた上でお取り扱いください。
ext_includeのエラーログにテンプレートパスが含まれていない
■現象
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)
Milestone: |
→ OpenPNE2.10.2
|
Keywords: |
OpenPNE2.8.7 added
|
Description: |
modified (diff)
|
Summary: |
ext_includeのエラー出力ミス →
ext_includeのエラーログにテンプレートパスが含まれていない
|
Owner: |
changed from nobody to ebihara
|
Status: |
new →
assigned
|
Description: |
modified (diff)
|
Description: |
modified (diff)
|
Keywords: |
確認中 added
|
Owner: |
changed from ebihara to ogawa
|
Status: |
assigned →
new
|
Keywords: |
確認中 removed
|
Owner: |
changed from ogawa to ebihara
|
Resolution: |
→ fixed
|
Status: |
new →
closed
|
Keywords: |
テスト待ち added
|
Resolution: |
fixed
|
Status: |
closed →
reopened
|
Keywords: |
テスト待ち removed
|
Resolution: |
→ fixed
|
Status: |
reopened →
closed
|
Keywords: |
OpenPNE2.11.2 added
|
Download in other formats:
やります