[Rt-commit] r9246 - in rt/branches/3.999-DANGEROUS: lib/RT lib/RT/Model

sunnavy at bestpractical.com sunnavy at bestpractical.com
Mon Oct 8 16:17:33 EDT 2007


Author: sunnavy
Date: Mon Oct  8 16:17:33 2007
New Revision: 9246

Modified:
   rt/branches/3.999-DANGEROUS/lib/RT/Date.pm
   rt/branches/3.999-DANGEROUS/lib/RT/Model/Ticket.pm
   rt/branches/3.999-DANGEROUS/t/api/ticket.t
   rt/branches/3.999-DANGEROUS/t/api/users.t

Log:
clean warnings

Modified: rt/branches/3.999-DANGEROUS/lib/RT/Date.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Date.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Date.pm	Mon Oct  8 16:17:33 2007
@@ -273,7 +273,7 @@
     if ( UNIVERSAL::isa( $other, 'RT::Date' ) ) {
         $other = $other->Unix;
     }
-    return undef unless $other > 0;
+    return undef unless $other=~ /^\d+$/ && $other > 0;
 
     my $unix = $self->Unix;
     return undef unless $unix > 0;

Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/Ticket.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/Ticket.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/Ticket.pm	Mon Oct  8 16:17:33 2007
@@ -2206,7 +2206,8 @@
     my $type  = shift || "";
 
     unless ( $self->{"$field$type"} ) {
-        $self->{"$field$type"} = new RT::Model::LinkCollection( $self->current_user );
+        $self->{"$field$type"} =
+          new RT::Model::LinkCollection( current_user => $self->current_user );
         if ( $self->current_user_has_right('ShowTicket') ) {
             # Maybe this ticket is a merged ticket
             my $Tickets = new RT::Model::TicketCollection( $self->current_user );

Modified: rt/branches/3.999-DANGEROUS/t/api/ticket.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/api/ticket.t	(original)
+++ rt/branches/3.999-DANGEROUS/t/api/ticket.t	Mon Oct  8 16:17:33 2007
@@ -100,7 +100,8 @@
 
 
 my $ticket = RT::Model::Ticket->new(RT->SystemUser);
-my ($id, $msg) = $ticket->create(Subject => "Foo",
+my $msg;
+($id, $msg) = $ticket->create(Subject => "Foo",
                 Owner => $RT::Nobody->id,
                 Status => 'open',
                 Requestor => ['jesse at example.com'],
@@ -140,7 +141,7 @@
 
 
 
-my $t = RT::Model::Ticket->new(RT->SystemUser);
+$t = RT::Model::Ticket->new(RT->SystemUser);
 ok($t->create(Queue => 'general', Subject => 'SquelchTest'));
 
 is(scalar $t->SquelchMailTo, 0, "The ticket has no squelched recipients");
@@ -159,8 +160,8 @@
 @names = $t->attributes->Names;
 is(shift @names, 'SquelchMailTo', "The attribute we have is SquelchMailTo");
 
-
-my ($ret, $msg) = $t->UnsquelchMailTo('nobody at example.com');
+my $ret;
+($ret, $msg) = $t->UnsquelchMailTo('nobody at example.com');
 ok($ret, "Removed nobody as a squelched recipient - ".$msg);
 @returned = $t->SquelchMailTo();
 is($#returned, -1, "The ticket has no squelched recipients". join(',', at returned));
@@ -174,7 +175,8 @@
 my $t2 = RT::Model::Ticket->new(RT->SystemUser);
 $t2->create ( Subject => 'Merge test 2', Queue => 'general', Requestor => 'merge2 at example.com');
 my $t2id = $t2->id;
-my ($msg, $val) = $t1->MergeInto($t2->id);
+my $val;
+($msg, $val) = $t1->MergeInto($t2->id);
 ok ($msg,$val);
 $t1 = RT::Model::Ticket->new(RT->SystemUser);
 is ($t1->id, undef, "ok. we've got a blank ticket1");

Modified: rt/branches/3.999-DANGEROUS/t/api/users.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/api/users.t	(original)
+++ rt/branches/3.999-DANGEROUS/t/api/users.t	Mon Oct  8 16:17:33 2007
@@ -4,7 +4,7 @@
 use RT::Test; use Test::More; 
 plan tests => 11;
 use RT;
-
+no warnings qw/redefine once/;
 
 
 use_ok('RT::Model::UserCollection');


More information about the Rt-commit mailing list