[Bps-public-commit] r8826 - RT-Extension-TicketAging/sbin

ruz at bestpractical.com ruz at bestpractical.com
Wed Aug 29 09:22:00 EDT 2007


Author: ruz
Date: Wed Aug 29 09:22:00 2007
New Revision: 8826

Modified:
   RT-Extension-TicketAging/sbin/rt-aging

Log:
* don't apply action if we couldn't load object and this really can happen
  when we shred a ticket with all its links

Modified: RT-Extension-TicketAging/sbin/rt-aging
==============================================================================
--- RT-Extension-TicketAging/sbin/rt-aging	(original)
+++ RT-Extension-TicketAging/sbin/rt-aging	Wed Aug 29 09:22:00 2007
@@ -101,9 +101,11 @@
         chomp $id;
 
         my $obj = $class->new( $objs->CurrentUser );
-        $obj->Load( $id );
-        $RT::Logger->error( loc "Couldn't load [_1] #[_2]", $class, $id )
-            unless $obj->id;
+        $obj->LoadById( $id );
+        unless ( $obj->id ) {
+            $RT::Logger->warning( loc "Couldn't load [_1] #[_2], may be it doesn't exist anymore", $class, $id );
+            next;
+        }
 
         my ($status, $msg) = apply_action(
             Object     => $obj,



More information about the Bps-public-commit mailing list