# Load goto to fix up user page links for logged-in commenters
IkiWiki::loadplugin("goto");
IkiWiki::loadplugin("inline");
+ IkiWiki::loadplugin("transient");
}
sub getsetup () {
$postcomment=0;
if (! $ok) {
- $location=unique_comment_location($page, $content, $config{srcdir}, "._comment_pending");
- writefile("$location._comment_pending", $config{srcdir}, $content);
+ $location=unique_comment_location($page, $content, $IkiWiki::Plugin::transient::transientdir, "._comment_pending");
+ writefile("$location._comment_pending", $IkiWiki::Plugin::transient::transientdir, $content);
# Refresh so anything that deals with pending
# comments can be updated.
}
my $page=IkiWiki::dirname($f);
- my $file="$config{srcdir}/$f";
- my $filedir=$config{srcdir};
+ my $filedir=$IkiWiki::Plugin::transient::transientdir;
+ my $file="$filedir/$f";
if (! -e $file) {
# old location
- $file="$config{wikistatedir}/comments_pending/".$f;
- $filedir="$config{wikistatedir}/comments_pending";
+ $file="$config{srcdir}/$f";
+ $filedir=$config{srcdir};
+ if (! -e $file) {
+ # older location
+ $file="$config{wikistatedir}/comments_pending/".$f;
+ $filedir="$config{wikistatedir}/comments_pending";
+ }
}
if ($action eq 'Accept') {
chdir($origdir) || die "chdir $origdir: $!";
};
+ $find_comments->($IkiWiki::Plugin::transient::transientdir, "._comment_pending");
+ # old location
$find_comments->($config{srcdir}, "._comment_pending");
# old location
$find_comments->("$config{wikistatedir}/comments_pending/",
refresh by querying git to find the files that were changed, rather
than looking at the work tree. Not enabled by default as it can
break some setups where not all files get committed to git.
+ * comments: Write pending moderation comments to the transient underlay
+ to avoid conflict with only_committed_changes.
-- Joey Hess <joeyh@debian.org> Thu, 05 Sep 2013 10:01:10 -0400
* [[plugins/autoindex]] can be configured to auto-create missing
pages that have a [[ikiwiki/subpage]] or an [[plugins/attachment]], but not
commit them, in which case they go in the transient underlay
-* [[plugins/comments]] can be configured to not commit comments: if so, it
- puts them in the transient underlay
+* [[plugins/comments]] writes comments pending moderation to the transient underlay
* [[plugins/recentchanges]] writes new changes into the transient underlay
* [[plugins/tag]] can be configured to auto-create missing
tag pages but not commit them, in which case they go in the transient
* Enable tagbase by default (so that tag autocreation will work by default).
Note that this is already done for wikis created by `auto-blog.setup`.
* [[tips/html5]] on by default (some day..)
-* Remove support for old `.ikiwiki/comments_pending` from comment plugin.
+* Remove support for old `.ikiwiki/comments_pending` and for
+ pending comments located in the srcdir, rather than transient underlay,
+ from comment plugin. That support makes comment moderation slow as
+ it has to check all the old locations.
In general, we try to use [[ikiwiki-transition]] or forced rebuilds on
upgrade to deal with changes that break compatability. Some things that