Bug: The ref-by feature doesn't find pluralized links.
Even though TWiki handles the Wiki:WikiNamePluralProblem
linking plural WikiWords
to the singular topics, the ref-by
feature will not find those references.
- Create a singular topic
- Create a plural reference
- Click the ref-by on the singular topic's page and notice that the plural reference isn't found.
- 18 Jan 2002
Is there any chance of getting this bug fixed? Does some knowledgable person agree that it is
- 26 Jul 2002
This looks like a bug - should be quite easy to fix though, all that's needed is to suffix
near the end of the regular expression that does the ref-by search, to also match topics that match with 'topic name plus S'.
Since that regex is in
, you can try fixing it yourself and see if this works. Change the line that includes the following (search for Ref-By to find it):
is the hex-encoded version of
- obtained using CygWin
$ echo -n '[Ss]?'| od -c -t x1
0000000 [ S s ] ?
5b 53 73 5d 3f
Let me know if this works.
Q: Do other people regard this as a bug? Or perhaps a simple enough feature that it would be worth adding it? If so, I will put it into CVS.
- 27 Jul 2002
The regex should basically do the reverse of this code in
$tmp =~ s/ies$/y/; # plurals like policy / policies
$tmp =~ s/sses$/ss/; # plurals like address / addresses
$tmp =~ s/([Xx])es$/$1/; # plurals like box / boxes
$tmp =~ s/([A-Za-rt-z])s$/$1/; # others, excluding ending ss like address(es)
Not sure how this can be done with a single regex. An aproximation is probably "good enough".
- 27 Jul 2002
I changed the template in a way similar to that RichardDonkin
suggests and it works
well enough for me. I think that using SPACEDTOPIC is broken
and it should, instead, be TOPIC. But that is perhaps a matter of
opinion. My argument is that appearences of a SPACEDTOPIC in a page
do not constitute a link and so ref-by shouldn't find them. I'm not
a regex expert so I dropped the fancy a-z stuff; I didn't really
do a good job.
My template looks like this:
Also, as a refactoring suggestion, this back referencing shows up in
a few places. Perhaps it should be factored out into a variable or
Thanks for the fix!
- 08 Aug 2002
So I've been thinking.
I don't think the right solution is to include a single regex in the
template for the search parameter for the SearchResult
I think one of the follwing is a better solution:
- Have a distinct SearchRefBy page that simply takes the
TOPIC value and that dynamically "does the right thing" with the
TOPIC to find all valid links.
- Have a
PLURALTOPICREGEX template replacement that allows the template expander to compute the correct regex for a WikiWord.
In each case the regex is computed
. Of course, I am way to stoopid to actually provide code.
BTW, does anyone have comments on my
- 13 Aug 2002
The spacedtopic is done to match Wiki links that are of the form web home
, i.e. spaced out text. Personally I think such links are a pain to get right in all cases, but it would be better to match the rest of the link syntax to avoid hits on normal text.
- 17 Aug 2002