[Rt-commit] [svn] r1923 - in rt/branches/3.2-RELEASE: . html/Ticket/Elements

jesse at pallas.eruditorum.org jesse at pallas.eruditorum.org
Mon Nov 22 13:11:57 EST 2004


Author: jesse
Date: Mon Nov 22 13:11:56 2004
New Revision: 1923

Modified:
   rt/branches/3.2-RELEASE/   (props changed)
   rt/branches/3.2-RELEASE/html/Ticket/Elements/ShowAttachments
Log:
 r9320 at tinbook:  jesse | 2004-11-22T18:13:24.717525Z
 RT-Ticket: 6264
 RT-Status: resolved
 RT-Update: correspond
 
 Fix the "ShowAttachments" component to deal gracefully, even if called without a 
 precached set of attachments.  From Rolf Grossmann.
 
 


Modified: rt/branches/3.2-RELEASE/html/Ticket/Elements/ShowAttachments
==============================================================================
--- rt/branches/3.2-RELEASE/html/Ticket/Elements/ShowAttachments	(original)
+++ rt/branches/3.2-RELEASE/html/Ticket/Elements/ShowAttachments	Mon Nov 22 13:11:56 2004
@@ -82,8 +82,12 @@
 % }
 
 <%INIT>
-my %documents;
 
+# If we haven't been passed in an Attachments object (through the precaching mechanism)
+# then we need to find one
+$Attachments ||= $m->comp('FindAttachments', Ticket => $Ticket);
+
+my %documents;
 while ( my $attach = $Attachments->Next() ) {
     next unless ($attach->Filename());
    unshift( @{ $documents{ $attach->Filename } }, $attach );


More information about the Rt-commit mailing list