aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2010-11-12 00:25:31 -0400
committerJoey Hess <joey@kitenet.net>2010-11-12 00:28:27 -0400
commit78de33d2eaf8a187b610685f70e60b7d5946374f (patch)
treecf430752e230cf50e37048c91e4b1f143ccab185
parent0ea5f43790fe2ce3cc40e9513191e72c67a1ee51 (diff)
downloadikiwiki-78de33d2eaf8a187b610685f70e60b7d5946374f.tar
ikiwiki-78de33d2eaf8a187b610685f70e60b7d5946374f.tar.gz
comments: Make postcomment() pagespec work when previewing a comment.
-rw-r--r--IkiWiki/Plugin/comments.pm6
-rw-r--r--debian/changelog2
2 files changed, 8 insertions, 0 deletions
diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm
index 851f4862e..57f5b1304 100644
--- a/IkiWiki/Plugin/comments.pm
+++ b/IkiWiki/Plugin/comments.pm
@@ -727,6 +727,10 @@ sub previewcomment ($$$) {
my $page=shift;
my $time=shift;
+ # Previewing a comment should implicitly enable comment posting mode.
+ my $oldpostcomment=$postcomment;
+ $postcomment=1;
+
my $preview = IkiWiki::htmlize($location, $page, '_comment',
IkiWiki::linkify($location, $page,
IkiWiki::preprocess($location, $page,
@@ -745,6 +749,8 @@ sub previewcomment ($$$) {
$template->param(have_actions => 0);
+ $postcomment=$oldpostcomment;
+
return $template->output;
}
diff --git a/debian/changelog b/debian/changelog
index 63e13896e..91a678805 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -11,6 +11,8 @@ ikiwiki (3.20101024) UNRELEASED; urgency=low
* Fix htmlscrubber_skip to be matched on the source page, not the page it is
inlined into. Should allow setting to "* and !comment(*)" to scrub
comments, but leave your blog posts unscrubbed, etc.
+ * comments: Make postcomment() pagespec work when previewing a comment,
+ including during moderation.
-- Joey Hess <joeyh@debian.org> Mon, 25 Oct 2010 22:30:29 -0400