summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2008-07-01 16:13:47 -0400
committerJoey Hess <joey@kodama.kitenet.net>2008-07-01 16:13:47 -0400
commit14cb2b0869496105915892b509016b9e46991ee7 (patch)
tree6f2f12bce6d206e2af908b7f95605590cd67c4d3 /IkiWiki/Plugin
parent1405006fbf8d78e3f629c60a98e01b5254de414e (diff)
save attachments when page is saved too
A user might specify an attachment, but not click the upload button, and just save the whole page instead.
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r--IkiWiki/Plugin/attachment.pm4
1 files changed, 1 insertions, 3 deletions
diff --git a/IkiWiki/Plugin/attachment.pm b/IkiWiki/Plugin/attachment.pm
index 4141cc04a..48cd954d9 100644
--- a/IkiWiki/Plugin/attachment.pm
+++ b/IkiWiki/Plugin/attachment.pm
@@ -52,7 +52,7 @@ sub formbuilder (@) { #{{{
return if $form->field("do") ne "edit";
- if ($form->submitted eq "Upload") {
+ if ($form->submitted eq "Upload" || $form->submitted eq "Save Page") {
my $q=$params{cgi};
my $session=$params{session};
@@ -112,7 +112,6 @@ sub formbuilder (@) { #{{{
error("failed to get filehandle");
}
binmode($fh);
- print STDERR "copying $filename\n";
writefile($filename, $config{srcdir}, undef, 1, sub {
IkiWiki::fast_file_copy($tempfile, $filename, $fh, @_);
});
@@ -128,7 +127,6 @@ sub formbuilder (@) { #{{{
IkiWiki::enable_commit_hook();
IkiWiki::rcs_update();
}
- print STDERR "refreshing\n";
IkiWiki::refresh();
IkiWiki::saveindex();
}