]> 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 06:06:21 +0000 (02:06 -0400)
committerJoey Hess <joey@kitenet.net>
Fri, 12 Nov 2010 06:06:21 +0000 (02:06 -0400)
(cherry picked from commit 78de33d2eaf8a187b610685f70e60b7d5946374f)

Conflicts:

debian/changelog

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 8ba3ce190975c0a511b6e9a5542dd651896fedd4..f94f69fd1188cae3e232a185093df732612de0d2 100644 (file)
@@ -14,6 +14,8 @@ ikiwiki (3.20100815.2) 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>  Sun, 15 Aug 2010 11:42:55 -0400