A user might specify an attachment, but not click the upload button,
and just save the whole page instead.
return if $form->field("do") ne "edit";
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};
my $q=$params{cgi};
my $session=$params{session};
error("failed to get filehandle");
}
binmode($fh);
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, @_);
});
writefile($filename, $config{srcdir}, undef, 1, sub {
IkiWiki::fast_file_copy($tempfile, $filename, $fh, @_);
});
IkiWiki::enable_commit_hook();
IkiWiki::rcs_update();
}
IkiWiki::enable_commit_hook();
IkiWiki::rcs_update();
}
- print STDERR "refreshing\n";
IkiWiki::refresh();
IkiWiki::saveindex();
}
IkiWiki::refresh();
IkiWiki::saveindex();
}