]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blob - doc/bugs/permalink_not_set_for_comments.mdwn
old regexp would have failed for old comment page names
[git.ikiwiki.info.git] / doc / bugs / permalink_not_set_for_comments.mdwn
1 Changes to comments result in notifyemail sending emails with broken urls like 
2 "http://whatever/foo/comment_1_10a49d69282155c5c3e66dc58f64f956/"
4 notifyemail uses meta permalink if set, so it must not be set for comment
5 pages.
7 In the comments plugin, there's this code, which is supposed to set
8 permalink:
10         if ($params{page} =~ m/\/\Q$config{comments_pagename}\E\d+_/) {
11                 $pagestate{$page}{meta}{permalink} = urlto(IkiWiki::dirname($params{page})).
12                         "#".page_to_id($params{page});
13         }
15 `comments_pagename` is `comment_` so the above code needs a comment page to contain
16 two underscores. I think that is the root of the bug. --[[Joey]]
18 > Removed the trailing underscore in the regexp, so it should be fixed,
19 > though I have not tested the fix. Leaving this bug open until it's
20 > confirmed fixed. (I deployed it to branchable.)
21
22 > This will only fix the stored permalink metadata for a comment when its get
23 > preprocessed again, not immediately. That's ok for notifyemail,
24 > but other uses of permalink might need a wiki rebuild to get the bug fix.
25 > --[[Joey]]
26 >
27 >> I'm not sure that I see how the regexp was wrong? It's looking for,
28 >> for example,
29 >>
30 >>     foo/comment_1_eaab671848ee6129f6fe9399474eeac0._comment
31 >>        sccccccccdu
32 >>
33 >> where
34 >>
35 >> * *s* marks the literal `/`
36 >> * *cccc* marks `comments_pagename`
37 >> * *d* marks `\d+` (one or more digits)
38 >> * *u* marks the literal `_`
39 >>
40 >> The old regexp would have failed for the older format
41 >> `foo/comment_1._comment`, though.
42 >>
43 >> --[[smcv]]