From: Joey Hess Date: Tue, 26 Aug 2008 16:51:28 +0000 (-0400) Subject: edittemplate: Don't wipe out edits on preview. X-Git-Tag: 2.53.1~7 X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/commitdiff_plain/dd2f1acbce012ff10d4015df9afead19efebdb30 edittemplate: Don't wipe out edits on preview. (cherry picked from commit d06096ad0d15dc7fb5e3187209a2908b3613b30b) --- diff --git a/IkiWiki/Plugin/edittemplate.pm b/IkiWiki/Plugin/edittemplate.pm index 76c1cd42a..3d31fd8f7 100644 --- a/IkiWiki/Plugin/edittemplate.pm +++ b/IkiWiki/Plugin/edittemplate.pm @@ -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 diff --git a/debian/changelog b/debian/changelog index 4a998d8b8..7afd852ce 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 Wed, 09 Jul 2008 21:30:33 -0700