[Rt-commit] r3688 - in rt/branches/3.5-TESTING: . html/SelfService lib/RT

jesse at bestpractical.com jesse at bestpractical.com
Thu Aug 18 17:52:11 EDT 2005


Author: jesse
Date: Thu Aug 18 17:52:10 2005
New Revision: 3688

Modified:
   rt/branches/3.5-TESTING/   (props changed)
   rt/branches/3.5-TESTING/html/SelfService/Display.html
   rt/branches/3.5-TESTING/lib/RT/Ticket_Overlay.pm
Log:
 r13214 at hualien:  jesse | 2005-08-18 15:42:14 -0400
  r13199 at hualien:  jesse | 2005-08-18 14:26:56 -0400
   r7158 at hualien:  jesse | 2005-07-30 11:08:03 -0400
    r4909 at hualien (orig r3501):  alexmv | 2005-07-18 15:00:38 -0400
     r5198 at zoq-fot-pik:  chmrr | 2005-07-18 14:59:07 -0400
      * Fix TransactionBatch / DESTROY bug (backport from QUEBEC)
    
    r7124 at hualien (orig r3546):  kevinr | 2005-07-28 14:51:34 -0400
     r6713 at SAD-GIRL-IN-SNOW:  kevinr | 2005-07-28 14:50:47 -0400
     RT-Ticket: 6892
     RT-Status: resolved
     RT-Update: correspond
     
     * Applied patch from Hsin-Chan Chien to fix a bug with attachment uploading
     in SelfService mode.
    
   
  
 


Modified: rt/branches/3.5-TESTING/html/SelfService/Display.html
==============================================================================
--- rt/branches/3.5-TESTING/html/SelfService/Display.html	(original)
+++ rt/branches/3.5-TESTING/html/SelfService/Display.html	Thu Aug 18 17:52:10 2005
@@ -93,6 +93,30 @@
 my @id = ( ref $id eq 'ARRAY' ) ? @{$id} : ($id);
 
 my $Ticket = new RT::Ticket( $session{'CurrentUser'} );
+
+# store the uploaded attachment in session
+if ( $ARGS{'Attach'} ) {    # attachment?
+    $session{'Attachments'} = {} unless defined $session{'Attachments'};
+
+    my $subject = "$ARGS{'Attach'}";
+
+    # since CGI.pm deutf8izes the magic field, we need to add it back.
+    Encode::_utf8_on($subject);
+
+    # strip leading directories
+    $subject =~ s#^.*[\\/]##;
+
+    my $attachment = MakeMIMEEntity(
+        Subject             => $subject,
+        Body                => "",
+        AttachmentFieldName => 'Attach'
+    );
+
+    $session{'Attachments'} =
+    { %{ $session{'Attachments'} || {} },
+        $ARGS{'Attach'} => $attachment };
+}
+
 if ( $id[0] eq 'new' ) {
 
     # {{{ Create a new ticket
@@ -110,28 +134,6 @@
         $m->abort;
     }
 
-    # {{{ store the uploaded attachment in session
-    if ( $ARGS{'Attach'} ) {    # attachment?
-        $session{'Attachments'} = {} unless defined $session{'Attachments'};
-
-        my $subject = "$ARGS{'Attach'}";
-
-        # since CGI.pm deutf8izes the magic field, we need to add it back.
-        Encode::_utf8_on($subject);
-
-        # strip leading directories
-        $subject =~ s#^.*[\\/]##;
-
-        my $attachment = MakeMIMEEntity(
-            Subject             => $subject,
-            Body                => "",
-            AttachmentFieldName => 'Attach'
-        );
-
-        $session{'Attachments'} =
-          { %{ $session{'Attachments'} || {} },
-            $ARGS{'Attach'} => $attachment };
-    }
 
     ( $Ticket, @results ) =
     CreateTicket( Attachments => $session{'Attachments'}, %ARGS, Status => 'new' );

Modified: rt/branches/3.5-TESTING/lib/RT/Ticket_Overlay.pm
==============================================================================
--- rt/branches/3.5-TESTING/lib/RT/Ticket_Overlay.pm	(original)
+++ rt/branches/3.5-TESTING/lib/RT/Ticket_Overlay.pm	Thu Aug 18 17:52:10 2005
@@ -3379,6 +3379,11 @@
 sub DESTROY {
     my $self = shift;
 
+    # DESTROY methods need to localize $@, or it may unset it.  This
+    # causes $m->abort to not bubble all of the way up.  See perlbug
+    # http://rt.perl.org/rt3/Ticket/Display.html?id=17650
+    local $@;
+
     # The following line eliminates reentrancy.
     # It protects against the fact that perl doesn't deal gracefully
     # when an object's refcount is changed in its destructor.


More information about the Rt-commit mailing list