summaryrefslogtreecommitdiff
path: root/IkiWiki
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2008-05-02 13:02:07 -0400
committerJoey Hess <joey@kodama.kitenet.net>2008-05-02 13:02:07 -0400
commitb2dea99417ebfee3d448ab6b49ca58cb2780258d (patch)
tree2ef858a5bd85d9fb500554933c002eb805e43d94 /IkiWiki
parent9fca7f2f8b64f4caded4a0099cef1f4d152dabee (diff)
Fix ugly display when editing a page that has vanished.
srcfile now has an optional second parameter to avoid it throwing an error if the source file does not exist.
Diffstat (limited to 'IkiWiki')
-rw-r--r--IkiWiki/CGI.pm2
-rw-r--r--IkiWiki/Plugin/shortcut.pm2
2 files changed, 2 insertions, 2 deletions
diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm
index 65136a269..781974c13 100644
--- a/IkiWiki/CGI.pm
+++ b/IkiWiki/CGI.pm
@@ -503,7 +503,7 @@ sub cgi_editpage ($$) { #{{{
my $exists=-e "$config{srcdir}/$file";
if ($form->field("do") ne "create" && ! $exists &&
- ! eval { srcfile($file) }) {
+ ! defined srcfile($file, 1)) {
$form->tmpl_param("page_gone", 1);
$form->field(name => "do", value => "create", force => 1);
$form->tmpl_param("page_select", 0);
diff --git a/IkiWiki/Plugin/shortcut.pm b/IkiWiki/Plugin/shortcut.pm
index c3e1f5446..f1a38ea48 100644
--- a/IkiWiki/Plugin/shortcut.pm
+++ b/IkiWiki/Plugin/shortcut.pm
@@ -13,7 +13,7 @@ sub import { #{{{
sub checkconfig () { #{{{
# Preprocess the shortcuts page to get all the available shortcuts
# defined before other pages are rendered.
- my $srcfile=eval {srcfile("shortcuts.mdwn")};
+ my $srcfile=srcfile("shortcuts.mdwn", 1);
if (! defined $srcfile) {
error(gettext("shortcut plugin will not work without a shortcuts.mdwn"));
}