aboutsummaryrefslogtreecommitdiff
path: root/doc/bugs/discussion_removal.mdwn
blob: 9e08361a3ecb7eeadf5986f5c44fa441e598e9cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
If a page has a discussion page, which is then removed, ikiwiki seems not
to notice that the discussion page has gone away, and does not update the
link to it in the action bar.

> Reprocued with 2.5 --[[Joey]]

Looks to me like loadindex is populating %destsources with information
that the old discussion page exists, which isn't invalidated when ikiwiki
discovers that the page is gone. This leaves dangling links whenever *any*
page is deleted, not just a discussion page. --Ethan

Here's a patch that trawls through %destsources deleting pages when they
are found to be deleted. It's a little inelegant, but it's simple and it 
works. --Ethan

<pre>
diff -urX ignorepats ikiwiki/IkiWiki/Render.pm ikidev/IkiWiki/Render.pm
--- ikiwiki/IkiWiki/Render.pm	2007-07-25 15:58:24.501068000 -0700
+++ ikidev/IkiWiki/Render.pm	2007-07-25 20:08:32.966449000 -0700
@@ -320,6 +320,11 @@
 			prune($config{destdir}."/".$_)
 				foreach @{$oldrenderedfiles{$page}};
 			delete $pagesources{$page};
+			foreach (keys %destsources){
+				if ($destsources{$_} == $page) {
+					delete $destsources{$_};
+				}
+			}
 		}
 	}
 
</pre>