]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
fixed previewing of attachments from holding area
authorJoey Hess <joey@kitenet.net>
Tue, 14 Jun 2011 18:08:13 +0000 (14:08 -0400)
committerJoey Hess <joey@kitenet.net>
Tue, 14 Jun 2011 18:08:13 +0000 (14:08 -0400)
IkiWiki/Plugin/attachment.pm

index 06b0c6c51685ebb3206b1411b5ba52f2df236e71..eb8846d06f885f7b2ec4b373cf0dceebe0039185 100644 (file)
@@ -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});
        }