From dd2f1acbce012ff10d4015df9afead19efebdb30 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 26 Aug 2008 12:51:28 -0400 Subject: [PATCH] edittemplate: Don't wipe out edits on preview. (cherry picked from commit d06096ad0d15dc7fb5e3187209a2908b3613b30b) --- IkiWiki/Plugin/edittemplate.pm | 4 +++- debian/changelog | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) 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 -- 2.39.2