[Rt-commit] r8691 - rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Interface

ruz at bestpractical.com ruz at bestpractical.com
Wed Aug 22 17:18:06 EDT 2007


Author: ruz
Date: Wed Aug 22 17:18:06 2007
New Revision: 8691

Modified:
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Interface/Web.pm

Log:
* delete empty hash reference as it's true value, but we should treat
  it as false.

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Interface/Web.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Interface/Web.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Interface/Web.pm	Wed Aug 22 17:18:06 2007
@@ -516,7 +516,11 @@
         @_
     );
 
-    my @results;
+    if ( $args{ARGSRef}->{'UpdateAttachments'}
+        && !keys %{$args{ARGSRef}->{'UpdateAttachments'}} )
+    {
+        delete $args{ARGSRef}->{'UpdateAttachments'};
+    }
 
     #Make the update content have no 'weird' newlines in it
     return () unless    $args{ARGSRef}->{'UpdateTimeWorked'}
@@ -530,7 +534,7 @@
     if ( $args{'SkipSignatureOnly'} ) {
         my $sig = $args{'TicketObj'}->CurrentUser->UserObj->Signature || '';
         $sig =~ s/^\s*|\s*$//g;
-        if( $args{ARGSRef}->{'UpdateContent'} =~ /^\s*(--)?\s*\Q$sig\E\s*$/ ) {
+        if ( $args{ARGSRef}->{'UpdateContent'} =~ /^\s*(--)?\s*\Q$sig\E\s*$/ ) {
             return () unless $args{ARGSRef}->{'UpdateTimeWorked'} ||
                              $args{ARGSRef}->{'UpdateAttachments'};
 
@@ -621,6 +625,7 @@
         }
     }
 
+    my @results;
     if ( $args{ARGSRef}->{'UpdateType'} =~ /^(private|public)$/ ) {
         my ( $Transaction, $Description, $Object ) = $args{TicketObj}->Comment(%message_args);
         push( @results, $Description );


More information about the Rt-commit mailing list