• 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.

Item6447: File attachment version should be returned to user as $fileVersion

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Extension AttachmentListPlugin Enhancement New   n/a  

Edit Form Data

Summary:
Reported By:
Codebase:
Applies To:
Component:
Priority:
Current State:
Waiting For:
Target Release:
Released In:
 

Detail

The attachment version should be returned to the user as $fileVersion. This is useful!

Here is the patch. The fix for Item6646 is included.

--- AttachmentListPlugin.pm.orig   2010-05-05 22:25:23.000000000 -0400
+++ AttachmentListPlugin.pm   2010-05-05 22:58:32.000000000 -0400
@@ -343,6 +343,7 @@
 
     foreach my $fileData (@files) {
 
+        my $attrVersion = $fileData->{attachment}->{version} || '';
         my $attrComment = $fileData->{attachment}->{comment} || '';
         my $attrAttr = $fileData->{attachment}->{attr};
 
@@ -380,6 +381,7 @@
         $s =~ s/\$fileName/$fileData->{name}/g;
         $s =~ s/\$fileIcon/%ICON{"$fileExtension"}%/g;
         $s =~ s/\$fileSize/$attrSizeStr/g;
+        $s =~ s/\$fileVersion/$attrVersion/g;
         $s =~ s/\$fileComment/$attrComment/g;
         $s =~ s/\$fileExtension/$fileExtension/g;
         $s =~ s/\$fileDate/_formatDate($fileData->{date})/ge;
@@ -394,7 +396,6 @@
         }
 
         if ( $s =~ m/\$viewfileUrl/ ) {
-            my $attrVersion = $fileData->{attachment}->{Version} || '';
             my $viewfileUrl =
               TWiki::Func::getScriptUrl( $fileData->{web}, $fileData->{topic},
                 "viewfile" )

-- TWiki:Main/SeanLazar - 06 May 2010

Thanks Sean! See my comment in TWiki:Plugins/AttachmentListPluginDev.

-- TWiki:Main.PeterThoeny - 06 May 2010

ItemTemplate
Summary File attachment version should be returned to user as $fileVersion
ReportedBy TWiki:Main.SeanLazar
Codebase 4.3.1
SVN Range TWiki-5.0.0-rc1, Mon, 03 May 2010, build 18580
AppliesTo Extension
Component AttachmentListPlugin
Priority Enhancement
CurrentState New
WaitingFor

Checkins

TargetRelease n/a
ReleasedIn

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