diff options
author | Joey Hess <joey@kodama.kitenet.net> | 2008-06-04 15:00:24 -0400 |
---|---|---|
committer | Joey Hess <joey@kodama.kitenet.net> | 2008-06-04 15:00:24 -0400 |
commit | ea5da191899d5c8b9cc225ec014bd7f6c7490b79 (patch) | |
tree | e072122384add4626e4b67981fc92a9168154a25 /IkiWiki/Plugin | |
parent | e4119f048c9ddd8795df378ff1ad676dca28de82 (diff) | |
download | ikiwiki-ea5da191899d5c8b9cc225ec014bd7f6c7490b79.tar ikiwiki-ea5da191899d5c8b9cc225ec014bd7f6c7490b79.tar.gz |
fix uninitialized value problem
This occurred when a plugin, loaded earlier, filled out a template in its
checkconfig, before recentchanges's checkconfig had run. Since such a
template won't be a recentchanges template, just test for the value being
uninitialized and skip processing.
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r-- | IkiWiki/Plugin/recentchanges.pm | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/IkiWiki/Plugin/recentchanges.pm b/IkiWiki/Plugin/recentchanges.pm index 3020b6a6a..f4f9ca348 100644 --- a/IkiWiki/Plugin/recentchanges.pm +++ b/IkiWiki/Plugin/recentchanges.pm @@ -40,14 +40,8 @@ sub pagetemplate (@) { #{{{ my $template=$params{template}; my $page=$params{page}; - # XXX this is here because I've been seeing a strange uninitialized - # value in this sub. - if (! defined $config{recentchangespage}) { - eval q{use Carp}; - Carp::cluck("undefined recentchangespage; please report this to Joey"); - } - - if ($config{rcs} && $page ne $config{recentchangespage} && + if (defined $config{recentchangespage} && $config{rcs} && + $page ne $config{recentchangespage} && $template->query(name => "recentchangesurl")) { $template->param(recentchangesurl => urlto($config{recentchangespage}, $page)); $template->param(have_actions => 1); |