]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
comments: Make postcomment() pagespec work when previewing a comment.
authorJoey Hess <joey@kitenet.net>
Fri, 12 Nov 2010 04:25:31 +0000 (00:25 -0400)
committerJoey Hess <joey@kitenet.net>
Fri, 12 Nov 2010 04:28:27 +0000 (00:28 -0400)
IkiWiki/Plugin/comments.pm
debian/changelog

index 851f4862eb3a5a39bb0afb387b35dfc60262024d..57f5b13045bdafa8c98d02288bc423fddee4ff0d 100644 (file)
@@ -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;
 }
 
index 63e13896ed0e5f5ba80caab4542b85655d6965db..91a678805913bf80fb28169d0c2ed1d95a56dcb9 100644 (file)
@@ -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