X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=rt%2Flib%2FRT%2FShredder.pm;fp=rt%2Flib%2FRT%2FShredder.pm;h=13ce0fb5ca6105020d662ec58f283f457e396988;hp=108164d4404b826a1e971519f2e96b37c92682b2;hb=187086c479a09629b7d180eec513fb7657f4e291;hpb=4639e25a658d9a0bf295415642fae8e8cdad846a diff --git a/rt/lib/RT/Shredder.pm b/rt/lib/RT/Shredder.pm index 108164d44..13ce0fb5c 100644 --- a/rt/lib/RT/Shredder.pm +++ b/rt/lib/RT/Shredder.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2017 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2018 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 );