• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

Item6391: Link to attachments in sub-webs are broken

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Extension AttachmentListPlugin Normal Being Worked On   n/a  

Edit Form Data

Reported By:
Applies To:
Current State:
Waiting For:
Target Release:
Released In:


Reported by TWiki:Main/BretHuang on 2010-01-26 in TWiki:Plugins/AttachmentListPluginDev

Suggested fix by Bret:

sub _formatFileData ,
        #Due to sub web ex: QualityKM/Practice translate to QualityKM%2fPractice
        # translate %2f back to /
        $webEnc =~ s/\%2f/\//g ;

-- TWiki:Main/PeterThoeny - 26 Jan 2010

Hello Peter and Bret, better to use URI::Escape than just regular expression suggested above. Something like following fixes the issue

Index: AttachmentListPlugin.pm
--- AttachmentListPlugin.pm     (revision 18314)
+++ AttachmentListPlugin.pm     (working copy)
@@ -414,6 +414,9 @@
         my $fileEnc = $fileData->{name};
         $fileEnc =~ s/([^-_.a-zA-Z0-9])/sprintf("%%%02x",ord($1))/eg;
         my $fileUrl = "$pubUrl/$webEnc/$topicEnc/$fileEnc";
+       use URI::Escape;
+       $fileUrl = uri_unescape($fileUrl);
         $s =~ s/\$fileUrl/$fileUrl/g;
         $s =~ s/\$fileTopic/$fileData->{topic}/g;

-- TWiki/Main.SopanShewale - 04 Feb 2010

The code is in repository.

-- TWiki/Main.SopanShewale - 11 Feb 2010

Summary Link to attachments in sub-webs are broken
ReportedBy TWiki:Main.PeterThoeny
Codebase ~twiki4
SVN Range TWiki-5.0.0, Sat, 02 Jan 2010, build 18269
AppliesTo Extension
Component AttachmentListPlugin
Priority Normal
CurrentState Being Worked On

Checkins TWikirev:18326
TargetRelease n/a

Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View |  Raw edit | More topic actions
Topic revision: r4 - 2010-02-11 - SopanShewale
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2023 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback