[Rt-commit] rt branch, 4.4/serialize-json-initialdata, updated. rt-4.4.1-335-ga718a4c
Shawn Moore
shawn at bestpractical.com
Tue Mar 14 17:34:18 EDT 2017
The branch, 4.4/serialize-json-initialdata has been updated
via a718a4ceaaef979d8c4ac7e80fef83659f99064a (commit)
from 7500606c2457b8b5313cea072e872fb9aa2ea081 (commit)
Summary of changes:
lib/RT/Handle.pm | 11 +++++++----
lib/RT/Migrate/Serializer/JSON.pm | 5 +++--
2 files changed, 10 insertions(+), 6 deletions(-)
- Log -----------------------------------------------------------------
commit a718a4ceaaef979d8c4ac7e80fef83659f99064a
Author: Shawn M Moore <shawn at bestpractical.com>
Date: Tue Mar 14 21:33:54 2017 +0000
Handle ObjectScrip Stage in both serializer and initialdata importer
diff --git a/lib/RT/Handle.pm b/lib/RT/Handle.pm
index 30f38b1..43117c6 100644
--- a/lib/RT/Handle.pm
+++ b/lib/RT/Handle.pm
@@ -1373,11 +1373,14 @@ sub InsertData {
$RT::Logger->debug( $return ."." );
}
foreach my $q ( @queues ) {
- my ($return, $msg) = $new_entry->AddToObject(
- ObjectId => $q,
- Stage => $item->{'Stage'},
+ my %args = (
+ Stage => $item->{'Stage'},
+ (ref($q) ? %$q : (ObjectId => $q)),
);
- $RT::Logger->error( "Couldn't apply scrip to $q: $msg" )
+
+ my ($return, $msg) = $new_entry->AddToObject(%args);
+
+ $RT::Logger->error( "Couldn't apply scrip to $args{ObjectId}: $msg" )
unless $return;
}
}
diff --git a/lib/RT/Migrate/Serializer/JSON.pm b/lib/RT/Migrate/Serializer/JSON.pm
index 418d9c6..8db8e3d 100644
--- a/lib/RT/Migrate/Serializer/JSON.pm
+++ b/lib/RT/Migrate/Serializer/JSON.pm
@@ -232,9 +232,10 @@ sub CanonicalizeObjects {
primary_class => 'RT::Scrip',
primary_key => 'Queue',
canonicalize_object => sub {
- ref($_->{ObjectId})
+ my $object = ref($_->{ObjectId})
? $self->_GetRecordByRef(${ $_->{ObjectId} })->{Name}
- : $_->{ObjectId}
+ : $_->{ObjectId};
+ return { ObjectId => $object, Stage => $_->{Stage} };
},
);
}
-----------------------------------------------------------------------
More information about the rt-commit
mailing list