aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2008-08-25 20:51:10 -0400
committerJoey Hess <joey@kodama.kitenet.net>2008-08-25 20:51:10 -0400
commitd06096ad0d15dc7fb5e3187209a2908b3613b30b (patch)
tree4307a04bbf252352f35ec59f19ac2a4abd227551
parent3c542cc27948542026729f7a8c0e03731236c1e0 (diff)
downloadikiwiki-d06096ad0d15dc7fb5e3187209a2908b3613b30b.tar
ikiwiki-d06096ad0d15dc7fb5e3187209a2908b3613b30b.tar.gz
edittemplate: Don't wipe out edits on preview.
-rw-r--r--IkiWiki/Plugin/edittemplate.pm4
-rw-r--r--debian/changelog1
-rw-r--r--doc/bugs/previewing_with_an_edittemplate_reverts_edit_box.mdwn2
3 files changed, 6 insertions, 1 deletions
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
diff --git a/debian/changelog b/debian/changelog
index c6f5fa6ee..0730c1f3f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -16,6 +16,7 @@ ikiwiki (2.62) UNRELEASED; urgency=low
* listdirectives: New plugin. (willu)
* filecheck: New plugin factoring out the PageSpec additions that were
originally part of the attachment plugin.
+ * edittemplate: Don't wipe out edits on preview.
-- Joey Hess <joeyh@debian.org> Thu, 21 Aug 2008 16:20:58 -0400
diff --git a/doc/bugs/previewing_with_an_edittemplate_reverts_edit_box.mdwn b/doc/bugs/previewing_with_an_edittemplate_reverts_edit_box.mdwn
index bd59ecc2f..162bcf9ab 100644
--- a/doc/bugs/previewing_with_an_edittemplate_reverts_edit_box.mdwn
+++ b/doc/bugs/previewing_with_an_edittemplate_reverts_edit_box.mdwn
@@ -1 +1,3 @@
It appears that the 'editcontent' textarea that should be saved across previews is being overridden whenever an edittemplate is in use, 'losing' edits on preview unless the browser maintains them in history.
+
+> ugly one... [[done]] --[[Joey]]