From d06096ad0d15dc7fb5e3187209a2908b3613b30b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 25 Aug 2008 20:51:10 -0400 Subject: edittemplate: Don't wipe out edits on preview. --- IkiWiki/Plugin/edittemplate.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'IkiWiki/Plugin') diff --git a/IkiWiki/Plugin/edittemplate.pm b/IkiWiki/Plugin/edittemplate.pm index cdcdd074f..98308de13 100644 --- a/IkiWiki/Plugin/edittemplate.pm +++ b/IkiWiki/Plugin/edittemplate.pm @@ -64,7 +64,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 -- cgit v1.2.3