[Rt-commit] [rtir] 04/08: Remove clever use of return 1

Kevin Falcone falcone at bestpractical.com
Fri Apr 18 21:20:54 EDT 2014


This is an automated email from the git hooks/post-receive script.

falcone pushed a commit to branch 3.2/test-fixes
in repository rtir.

commit f804933cca647cf29e3c648cbcbced227d41fad4
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Fri Apr 18 14:57:54 2014 -0400

    Remove clever use of return 1
    
    This code was returning 1 to skip the scrip, which made no sense until I
    examined the Prepare code which punts unless $self->{set_status_to} is
    set.  I'm not sure why we should even bother letting Commit run, just
    bail out in the Prepare and move on.  It also makes the intent of this
    code much much clearer.
    
    This showed up in the t/dates/started.t test which expects a
    correspondence on an IR to leave the ticket New and thus avoid having
    Started set.
---
 lib/RT/IR.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/RT/IR.pm b/lib/RT/IR.pm
index 4abe138..37bc74d 100644
--- a/lib/RT/IR.pm
+++ b/lib/RT/IR.pm
@@ -729,7 +729,7 @@ require RT::Action::AutoOpen;
         my $self = shift;
         my $ticket = $self->TicketObj;
         my $type = RT::IR::TicketType( Ticket => $ticket );
-        return 1 if $type && ( $type eq 'Block' || $type eq 'Report' );
+        return 0 if $type && ( $type eq 'Block' || $type eq 'Report' );
         return $self->$prepare(@_);
     };
 }
@@ -741,7 +741,7 @@ require RT::Action::AutoOpenInactive;
         my $self = shift;
         my $ticket = $self->TicketObj;
         my $type = RT::IR::TicketType( Ticket => $ticket );
-        return 1 if $type && ( $type eq 'Block' || $type eq 'Report' );
+        return 0 if $type && ( $type eq 'Block' || $type eq 'Report' );
         return $self->$prepare(@_);
     };
 }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the rt-commit mailing list