From c55a32d3e18e5ed72be0dd74461f33ee5e39ef12 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 14 Jun 2011 14:08:13 -0400 Subject: [PATCH] fixed previewing of attachments from holding area --- IkiWiki/Plugin/attachment.pm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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}); } -- 2.26.2