[Rt-commit] r6314 - in rt/branches/3.7-EXPERIMENTAL: .

ruz at bestpractical.com ruz at bestpractical.com
Fri Oct 27 01:41:10 EDT 2006


Author: ruz
Date: Fri Oct 27 01:41:09 2006
New Revision: 6314

Modified:
   rt/branches/3.7-EXPERIMENTAL/   (props changed)
   rt/branches/3.7-EXPERIMENTAL/lib/RT/Transaction_Overlay.pm

Log:
 r4052 at cubic-pc:  cubic | 2006-10-27 06:57:12 +0400
 ::Transaction->Attachments
 * if attachments are cached then we must drop the iterator to first
   position each time a user calls the method.


Modified: rt/branches/3.7-EXPERIMENTAL/lib/RT/Transaction_Overlay.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/lib/RT/Transaction_Overlay.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL/lib/RT/Transaction_Overlay.pm	Fri Oct 27 01:41:09 2006
@@ -431,8 +431,10 @@
 sub Attachments {
     my $self = shift;
 
-    unless ( $self->{'attachments'} ) {
-        $self->{'attachments'} = RT::Attachments->new( $self->CurrentUser );
+    if ( $self->{'attachments'} ) {
+        $self->{'attachments'}->GotoFirstItem;
+        return $self->{'attachments'};
+    }
 
         #If it's a comment, return an empty object if they don't have the right to see it
         if ( $self->Type eq 'Comment' ) {
@@ -460,7 +462,6 @@
                                          FIELD => 'id',
                                          ORDER => 'asc' );
 
-    }
     return ( $self->{'attachments'} );
 
 }


More information about the Rt-commit mailing list