[kupu-dev] Kupu says links are bad when they aren't
Duncan Booth
duncan.booth at suttoncourtenay.org.uk
Thu Apr 12 17:32:04 CEST 2007
sisi <sisi at foei.org> wrote:
> One question we have is:
> Where is the code that identifies links for checking? Is it in kupu or
> is kupu calling it from a function or something in Plone? Because we'd
> like to look at the code and make some progress that way but we can't
> find it, using all our ninja powers of grep and find etc :-)
>
Aha. I think I can answer that question.
Look in Products/kupu/plone/html2captioned.py
Specifically the class Migration:
object_check checks the links in a single object.
classifyLink tries to figure out whether the link is relative, absolute,
uid based or broken.
What I would suggest is that you put some print statements in checklink:
e.g. print link, base, classification
and then run zope foregrounded so you can see how it categorises each link
and if you disagree with what its doing email me with details of what you
think it should be doing instead.
If the problem is that it isn't finding links at all (i.e. checklink isn't
being called when it should be called) then prints or breakpoints near the
line:
newdata = LINK_PATTERN.sub(checklink, data)
may help. data is the original value of the field, newdata is the updated
value after doing the substitution to fix up the links. The regular
expression matching could well be broken.
Duncan
More information about the kupu-dev
mailing list