]> sipb.mit.edu Git - ikiwiki.git/blob - doc/bugs/discussion_removal.mdwn
web commit by http://ethan.betacantrips.com/: fix
[ikiwiki.git] / doc / bugs / discussion_removal.mdwn
1 If a page has a discussion page, which is then removed, ikiwiki seems not
2 to notice that the discussion page has gone away, and does not update the
3 link to it in the action bar.
4
5 > Reprocued with 2.5 --[[Joey]]
6
7 Looks to me like loadindex is populating %destsources with information
8 that the old discussion page exists, which isn't invalidated when ikiwiki
9 discovers that the page is gone. This leaves dangling links whenever *any*
10 page is deleted, not just a discussion page. --Ethan
11
12 Here's a patch that trawls through %destsources deleting pages when they
13 are found to be deleted. It's a little inelegant, but it's simple and it 
14 works. --Ethan
15
16 <pre>
17 diff -urX ignorepats ikiwiki/IkiWiki/Render.pm ikidev/IkiWiki/Render.pm
18 --- ikiwiki/IkiWiki/Render.pm   2007-07-25 15:58:24.501068000 -0700
19 +++ ikidev/IkiWiki/Render.pm    2007-07-25 20:08:32.966449000 -0700
20 @@ -320,6 +320,11 @@
21                         prune($config{destdir}."/".$_)
22                                 foreach @{$oldrenderedfiles{$page}};
23                         delete $pagesources{$page};
24 +                       foreach (keys %destsources){
25 +                               if ($destsources{$_} == $page) {
26 +                                       delete $destsources{$_};
27 +                               }
28 +                       }
29                 }
30         }
31  
32 </pre>
33