[Rt-devel] PATCH: silence warnings Ticket/Elements/ShowTransactionAttachments

Jim Meyer purp at acm.org
Wed Nov 16 16:50:43 EST 2005


Hello!

On Wed, 2005-11-16 at 13:14, Ruslan Zakirov wrote:
> IMHO it's bug and do remember that I saw patch that fixes bug.
> Do you generate patches against 3.4.HEAD or 3.4.4?

Sorry, I should have said -- these patches are all against 3.5.5. If
there's been a previous bug and patch, please ignore this patch.

> PS: size_name is bad name, size_text or size_string is better.

size_string it is. New patch attached.

Cheers!

--j

> On 11/17/05, Jim Meyer <purp at acm.org> wrote:
> > Attached. Problem was a premature stringification and localization for
> > display so I separated the display item from the number for later
> > comparison.
> >
> > --j
> > --
> > Jim Meyer, Geek at Large                  jmeyer at dreamworksanimation.com
> >
> >
> > _______________________________________________
> > Rt-devel mailing list
> > Rt-devel at lists.bestpractical.com
> > http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel
> >
> >
> >
> >
> 
> 
> --
> Best regards, Ruslan.
-- 
Jim Meyer, Geek at Large                  jmeyer at dreamworksanimation.com
-------------- next part --------------
--- share/html/Ticket/Elements/ShowTransactionAttachments	2005-07-09 11:52:35.000000000 -0700
+++ local/html/Ticket/Elements/ShowTransactionAttachments	2005-11-16 13:49:36.000000000 -0800
@@ -63,26 +63,27 @@
 
     # }}}
     # {{{ if there's any size at all, show the download link
     my $size = $message->ContentLength;
+    my $size_string = '';
     if ($size) {
         
 </%perl> 
 <div class="downloadattachment">
 <%perl>
 
      #     show a download link
      if ( $size > 1024 ) {
-         $size = loc( "[_1]k", int( $size / 102.4 ) / 10 );
+         $size_string = loc( "[_1]k", int( $size / 102.4 ) / 10 );
      }
      else {
-        $size = loc( "[_1]b", $size );
+        $size_string = loc( "[_1]b", $size );
      }
         
 </%PERL> 
 <a href="<%$AttachPath%>/<%$Transaction->Id%>/<%$message->Id%>/<%$message->Filename | u%>"><&|/l&>Download</&> <%$message->Filename || loc('(untitled)') %></a>
 <span class="downloadcontenttype">
-[<%$message->ContentType%> <% $size %>]
+[<%$message->ContentType%> <% $size_string %>]
 </span> 
 </div>
 % }
 % # }}}


More information about the Rt-devel mailing list