[Rt-commit] rt branch, 4.2.15-releng, updated. rt-4.2.15beta1-6-g3f3dc51f4
? sunnavy
sunnavy at bestpractical.com
Mon Jun 18 14:28:32 EDT 2018
The branch, 4.2.15-releng has been updated
via 3f3dc51f4228820fef2accb48bee3f165c5eac40 (commit)
from bad1460a5aa659c650102903c04a37cf5b3b6bea (commit)
Summary of changes:
lib/RT/Shredder.pm | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
- Log -----------------------------------------------------------------
commit 3f3dc51f4228820fef2accb48bee3f165c5eac40
Author: Craig Kaiser <craig at bestpractical.com>
Date: Tue May 22 11:03:14 2018 -0400
Restrict Name checks to objects with Name and only when id is not numeric
92dc904 updated the id check in Shredder to handle the case where $id is actually a Name.
However, it breaks the case where $id is not a Name, which could produce errors like:
error: RT::Ticket::Name Unimplemented in RT::Shredder
This commit fixes it to:
* Not check Name if $id is numeric.
* Not check Name if object doesn't have it.
diff --git a/lib/RT/Shredder.pm b/lib/RT/Shredder.pm
index 68dc27656..13ce0fb5c 100644
--- a/lib/RT/Shredder.pm
+++ b/lib/RT/Shredder.pm
@@ -364,11 +364,15 @@ sub CastObjectsToRecords
RT::Shredder::Exception::Info->throw( 'CouldntLoadObject' );
}
- if ( $id =~ /^\d+$/ && $id ne $obj->Id ){
- die 'Loaded object id ' . $obj->Id . " is different from passed id $id";
+ if ( $id =~ /^\d+$/ ) {
+ if ( $id ne $obj->Id ) {
+ die 'Loaded object id ' . $obj->Id . " is different from passed id $id";
+ }
}
- elsif ( $id ne $obj->Name ){
- die 'Loaded object name ' . $obj->Name . " is different from passed name $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 {
-----------------------------------------------------------------------
More information about the rt-commit
mailing list