[Rt-commit] rt branch, 4.4/serialize-json-initialdata, updated. rt-4.4.1-407-g17fd33c

Shawn Moore shawn at bestpractical.com
Wed Mar 22 16:43:56 EDT 2017


The branch, 4.4/serialize-json-initialdata has been updated
       via  17fd33cd9599223ffb85b530297d6fcc497dc48e (commit)
      from  c8bc700e822c318f7113c6a46e73764f6572e932 (commit)

Summary of changes:
 lib/RT/ObjectScrip.pm         |  2 ++
 t/api/initialdata-roundtrip.t | 19 +++++++++++++++++++
 2 files changed, 21 insertions(+)

- Log -----------------------------------------------------------------
commit 17fd33cd9599223ffb85b530297d6fcc497dc48e
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Wed Mar 22 20:37:31 2017 +0000

    Make sure queue-specific templates get serialized

diff --git a/lib/RT/ObjectScrip.pm b/lib/RT/ObjectScrip.pm
index 495dcfd..e225a8a 100644
--- a/lib/RT/ObjectScrip.pm
+++ b/lib/RT/ObjectScrip.pm
@@ -269,6 +269,8 @@ sub FindDependencies {
         my $obj = RT::Queue->new( $self->CurrentUser );
         $obj->Load( $self->ObjectId );
         $deps->Add( out => $obj );
+
+        $deps->Add( out => $self->ScripObj->TemplateObj($obj->Id) );
     }
 }
 
diff --git a/t/api/initialdata-roundtrip.t b/t/api/initialdata-roundtrip.t
index 4ac476d..e8c4a0d 100644
--- a/t/api/initialdata-roundtrip.t
+++ b/t/api/initialdata-roundtrip.t
@@ -872,6 +872,16 @@ my @tests = (
                 Type => "Simple",
             );
             ok($ok, $msg);
+
+            my $standalone = RT::Template->new(RT->SystemUser);
+            ($ok, $msg) = $standalone->Create(
+                Name => 'Standalone test',
+                Queue => $general->Id,
+                Description => 'no global version',
+                Content => "this was broken!",
+                Type => "Perl",
+            );
+            ok($ok, $msg);
         },
         present => sub {
             my $global = RT::Template->new(RT->SystemUser);
@@ -891,6 +901,15 @@ my @tests = (
             is($queue->Description, 'override for Swedes', 'Description');
             is($queue->Content, 'Hello Hallå', 'Content');
             is($queue->Type, 'Simple', 'Type');
+
+            my $standalone = RT::Template->new(RT->SystemUser);
+            $standalone->LoadQueueTemplate(Name => 'Standalone test', Queue => $general->Id);
+            ok($standalone->Id, 'loaded template');
+            is($standalone->Name, 'Standalone test', 'Name');
+            is($standalone->Queue, $general->Id, 'Queue');
+            is($standalone->Description, 'no global version', 'Description');
+            is($standalone->Content, 'this was broken!', 'Content');
+            is($standalone->Type, 'Perl', 'Type');
         },
     },
     {

-----------------------------------------------------------------------


More information about the rt-commit mailing list