edittemplate: Don't wipe out edits on preview.
authorJoey Hess <joey@kodama.kitenet.net>
Tue, 26 Aug 2008 16:51:28 +0000 (12:51 -0400)
committerJoey Hess <joey@kodama.kitenet.net>
Tue, 26 Aug 2008 16:51:28 +0000 (12:51 -0400)
(cherry picked from commit d06096ad0d15dc7fb5e3187209a2908b3613b30b)

IkiWiki/Plugin/edittemplate.pm
debian/changelog

index 76c1cd42aed37b24ff3f313a50c0d49cd4112aa7..3d31fd8f7405e73e667bd0e0d1da390173577916 100644 (file)
@@ -54,7 +54,9 @@ sub formbuilder (@) { #{{{
        my %params=@_;
        my $form=$params{form};
 
-       return if $form->field("do") ne "create";
+       return if $form->field("do") ne "create" ||
+               length $form->field("editcontent");
+       
        my $page=$form->field("page");
        
        # The tricky bit here is that $page is probably just the base
index 4a998d8b87d2f11949c6c17e40e1e64607b9b533..7afd852ce413767751cad28d4e3d4380cadcf26f 100644 (file)
@@ -21,6 +21,7 @@ ikiwiki (2.53.1) UNRELEASED; urgency=low
   * toggle: Fix for when html got tidied. Closes: #492529 (Enrico Zini)
   * inline: Ignore parent dirs when sorting pages by title.
   * external: Fix support for hooks called in an array context.
+  * edittemplate: Don't wipe out edits on preview.
 
  -- Josh Triplett <josh@freedesktop.org>  Wed, 09 Jul 2008 21:30:33 -0700