Bug: [short description]
When looking for versions of the atachement, the version 1.1 is unaccesible.
Test case
Environment
--
RadekHnilica - 24 Jun 2005
Impact and Available Solutions
Follow up
Today contacted me one men asking If I can help him with atachments in TWiki. He says that he was not able get older versions of his atachments. After reproducing that error I found a very strange code line in Attach.pm file. So I quickly change the code and it seems that now it's allright. Please look at the patch.
Fix record
kiki:/tmp/twiki/lib/TWiki# diff -u Attach.pm.orig Attach.pm
--- Attach.pm.orig Fri Jun 24 14:03:26 2005
+++ Attach.pm Fri Jun 24 14:04:18 2005
@@ -179,7 +179,7 @@
if ( $row =~ /%A_URL%/o ) {
my $url;
- if ( $topRev || $rev eq "1.1" ) {
+ if ( $topRev ) {
# I18N: To support attachments via UTF-8 URLs to attachment
# directories/files that use non-UTF-8 character sets, go through viewfile.
# If using %PUBURL%, must URL-encode explicitly to site character set.
Discussion
this looks correct to me; this same fix has been previously applied to
DakarRelease. you might find this bit lifted from
DakarRelease useful to compare against your patch:
elsif ( $attr eq 'URL' ) {
my $url;
if ( $topRev ) {
# I18N: To support attachments via UTF-8 URLs to attachment
# directories/files that use non-UTF-8 character sets, go
# through viewfile.
# If using %PUBURL%, must URL-encode explicitly to site
# character set.
$url = TWiki::nativeUrlEncode( "$TWiki::cfg{PubUrlPath}/$web/$topic/$file" );
} else {
$url = $this->{session}->getScriptUrl
( $web, $topic, 'viewfile',
rev => $info->{version}, filename => $file );
}
return $url;
}
--
WillNorris - 25 Jun 2005
This is a duplicate of
AttachmentVersionsBrokenOnlyShowsLast.
--
MikeOliver - 29 Nov 2005