SID-01247: filenames translated by ATTACHURL
| Status: |
Answered |
TWiki version: |
5.0.2 |
Perl version: |
v5.8.8 |
| Category: |
CategoryRendering |
Server OS: |
Red Hat Enterprise Linux Server release 5.4 (Tikanga) |
Last update: |
14 years ago |
I am attempting to migrate a set of twiki files written by a vendor of our to our site. I've installed latest TWiki, and that went fine.
I have one issue remaining, that I've searched for hours, and have been unable to find an answer.
On my site it appears that the ATTACHURL macro is translating file names with underscores to spaces. For example. "leaves_movie.jpg" is coming back as "leaves movie.jpg", which is obviously not working.
What controls this substitution?
Thanks,
Ray Davis
--
RayDavis - 2011-08-04
Discussion and Answer
I have never seen this and I am not aware that the TWiki core is changing attachment names. Possibly a plugin that interferes? Disable all non-essential plugins in configure to find out.
Also, how to you use ATTACHURL? See usage at
VarATTACHURL and
VarPUBURL.
--
PeterThoeny - 2011-08-04
Peter,
Thanks for the response. I did exactly that, and found that it is the
EscapeStudios plugin that is causing this. Unfortunately, turning it off has the side-effect of causing the headings to now fail (which was the primary purpose of the plugin. It produces nicer human readable heading).
There is a comment on the plugin page to "install it last", but I'm not sure how to do that, thinking perhaps it is an order depending thing?
--
RayDavis - 2011-08-04
Time to fix the plugin. The plugin needs to check if links are attachment links, and if so, exclude the special treatment.
--
PeterThoeny - 2011-08-04
Thanks for the help, we can mark this closed. I ended up modify the source for the
EscapeStudiosplugin perl to handle the issue.
My guess is that something has changed between v4 and v5. The original docs I was trying to get online were from a v4 system, and I had downloaded and installed 5.0.2. The plugin registered a "renderWikiWordHandler", which removed the underscores from incoming string. This was intended to produce more human-readable links, and titles and breadcrumbs.
But, it seemed that in v5, that ATTACHURL was ultimately also calling this function, which was then changing filenames and removing underscores.
Rather than try to figure out what had changed (since I don't have a working v4 system), I modified the source to only change the underscores when the text didn't appear to be a filename.
That seems to work, at least for now.
Thanks,
ray
--
RayDavis - 2011-08-05
Glad it worked out, closing.
--
PeterThoeny - 2011-08-05
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.