aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2011-06-14 14:08:13 -0400
committerJoey Hess <joey@kitenet.net>2011-06-14 14:08:13 -0400
commitc55a32d3e18e5ed72be0dd74461f33ee5e39ef12 (patch)
tree51cee059b2ec7dd3492b57353fe5bee57215b044 /IkiWiki
parentd4d232740078d0cab15b4f78e797c0802b692e5c (diff)
downloadikiwiki-c55a32d3e18e5ed72be0dd74461f33ee5e39ef12.tar
ikiwiki-c55a32d3e18e5ed72be0dd74461f33ee5e39ef12.tar.gz
fixed previewing of attachments from holding area
Diffstat (limited to 'IkiWiki')
-rw-r--r--IkiWiki/Plugin/attachment.pm8
1 files changed, 7 insertions, 1 deletions
diff --git a/IkiWiki/Plugin/attachment.pm b/IkiWiki/Plugin/attachment.pm
index 06b0c6c51..eb8846d06 100644
--- a/IkiWiki/Plugin/attachment.pm
+++ b/IkiWiki/Plugin/attachment.pm
@@ -103,6 +103,12 @@ sub formbuilder_setup (@) {
else {
$form->tmpl_param("attachments-class" => "toggleable-open");
}
+
+ # Save attachments in holding area before previewing so
+ # they can be seen in the preview.
+ if ($form->submitted eq "Preview") {
+ attachments_save($form, $params{session});
+ }
}
}
@@ -118,7 +124,7 @@ sub formbuilder (@) {
($form->submitted eq "Upload Attachment" || $form->submitted eq "Save Page")) {
attachment_store($filename, $form, $q, $params{session});
}
- if ($form->submitted eq "Save Page" || $form->submitted eq "Preview") {
+ if ($form->submitted eq "Save Page") {
attachments_save($form, $params{session});
}