aboutsummaryrefslogtreecommitdiff
path: root/doc/bugs
diff options
context:
space:
mode:
authorharishcm <harishcm@web>2009-11-25 09:15:40 -0500
committerJoey Hess <joey@kitenet.net>2009-11-25 09:15:40 -0500
commitae64fadcce529d771c7b7047ba8859757847170a (patch)
tree06684a9147e1a8438cf96633f83eff0be8ca8b42 /doc/bugs
parentf4cb6edd0f4d32710e2ef6ddef7de1b06b103389 (diff)
downloadikiwiki-ae64fadcce529d771c7b7047ba8859757847170a.tar
ikiwiki-ae64fadcce529d771c7b7047ba8859757847170a.tar.gz
Diffstat (limited to 'doc/bugs')
-rw-r--r--doc/bugs/bestlink_returns_deleted_pages.mdwn54
1 files changed, 54 insertions, 0 deletions
diff --git a/doc/bugs/bestlink_returns_deleted_pages.mdwn b/doc/bugs/bestlink_returns_deleted_pages.mdwn
new file mode 100644
index 000000000..59e9dbcb5
--- /dev/null
+++ b/doc/bugs/bestlink_returns_deleted_pages.mdwn
@@ -0,0 +1,54 @@
+To reproduce:
+
+1. Add the backlinkbug plugin below to ikiwiki.
+2. Create a page named test.mdwn somewhere in the wiki.
+3. Refresh ikiwiki in verbose mode. Pages whose bestlink is the test.mwdn page will be printed to the terminal.
+4. Delete test.mdwn.
+5. Refresh ikiwiki in verbose mode again. The same pages will be printed to the terminal again.
+6. Refresh ikiwiki in verbose mode another time. Now no pages will be printed.
+
+bestlink() checks %links (and %pagecase) to confirm the existance of the page.
+However, find_del_files() does not remove the deleted page from %links (and %pagecase).
+
+Since find_del_files removes the deleted page from %pagesources and %destsources,
+won't it make sense for bestlink() to check %pagesources first? --[[harishcm]]
+
+
+----
+
+ #!/usr/bin/perl
+ # Plugin to reproduce bestlink returning deleted pages.
+ # Run with ikiwiki in verbose mode.
+
+ package IkiWiki::Plugin::bestlinkbug;
+
+ use warnings;
+ use strict;
+ use IkiWiki 3.00;
+
+ sub import {
+ hook(type => "getsetup", id => "bestlinkbug", call => \&getsetup);
+ hook(type => "needsbuild", id => "bestlinkbug", call => \&needsbuild);
+ }
+
+ sub getsetup () {
+ return
+ plugin => {
+ safe => 1,
+ rebuild => 0,
+ },
+ }
+
+ sub needsbuild (@) {
+ my $needsbuild=shift;
+
+ foreach my $page (keys %pagestate) {
+ my $testpage=bestlink($page, "test") || next;
+
+ debug("$page");
+ }
+ }
+
+ 1
+
+