X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Flib%2FRT%2FShredder.pm;h=aba894c8994a5950eea775228ef995e67596c4eb;hb=HEAD;hp=af675bd45c3a8616eeeacdb623170d2aa0788156;hpb=026dc7ad72ba972f230b6709e31fa64397d75ad4;p=freeside.git diff --git a/rt/lib/RT/Shredder.pm b/rt/lib/RT/Shredder.pm index af675bd45..aba894c89 100644 --- a/rt/lib/RT/Shredder.pm +++ b/rt/lib/RT/Shredder.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2019 Best Practical Solutions, LLC # # # (Except where explicitly superseded by other copyright notices) @@ -363,7 +363,17 @@ sub CastObjectsToRecords $RT::Logger->error( "Couldn't load '$class' object with id '$id'" ); RT::Shredder::Exception::Info->throw( 'CouldntLoadObject' ); } - die "Loaded object has different id" unless( $id eq $obj->id ); + + if ( $id =~ /^\d+$/ ) { + if ( $id ne $obj->Id ) { + die 'Loaded object id ' . $obj->Id . " is different from passed id $id"; + } + } + else { + if ( $obj->_Accessible( 'Name', 'read' ) && $id ne $obj->Name ) { + die 'Loaded object name ' . $obj->Name . " is different from passed name $id"; + } + } push @res, $obj; } else { RT::Shredder::Exception->throw( "Unsupported type ". ref $targets );