aboutsummaryrefslogtreecommitdiff
path: root/doc/bugs/pagestats_plugin_broken.mdwn
diff options
context:
space:
mode:
Diffstat (limited to 'doc/bugs/pagestats_plugin_broken.mdwn')
-rw-r--r--doc/bugs/pagestats_plugin_broken.mdwn29
1 files changed, 29 insertions, 0 deletions
diff --git a/doc/bugs/pagestats_plugin_broken.mdwn b/doc/bugs/pagestats_plugin_broken.mdwn
new file mode 100644
index 000000000..0ae74b4ee
--- /dev/null
+++ b/doc/bugs/pagestats_plugin_broken.mdwn
@@ -0,0 +1,29 @@
+Since at least version 2.0 (and certainly a few version before), it seems that the pagestats plugin is broken : each matched page has a count of 2.
+This is also (of course) producing flat tag cloud.
+
+My perl knowledge is very limited, but the call :
+
+ my @bl = IkiWiki::backlinks($page);
+ $counts{$page} = scalar(@bl);
+
+return allways 2, which seems to me "obvious", because the backlinks() function is returning two array of links...
+
+Patch is :
+
+ --- /usr/share/perl5/IkiWiki/Plugin/pagestats.pm 2007-04-27 04:33:43.000000000 +0200
+ +++ ./pagestats.pm 2007-05-12 16:47:14.000000000 +0200
+ @@ -36,7 +36,7 @@
+ if (pagespec_match($page, $params{pages}, location => $params{page})) {
+ use IkiWiki::Render;
+ my @bl = IkiWiki::backlinks($page);
+ - $counts{$page} = scalar(@bl);
+ + $counts{$page} = scalar(@{$bl[0]})+scalar(@{$bl[1]});
+ $max = $counts{$page} if $counts{$page} > $max;
+ }
+ }
+
+
+
+--[[users/hb]]
+
+thanks, [[done]] --[[Joey]]