[Rt-commit] rt branch, 4.4/dump-and-merge-initialdata, updated. rt-4.4.3-136-gb1185c6d62

? sunnavy sunnavy at bestpractical.com
Tue Feb 4 09:45:34 EST 2020


The branch, 4.4/dump-and-merge-initialdata has been updated
       via  b1185c6d62d75ffbd714cea7e769015db1864856 (commit)
      from  2d7b1f0384296938457984ceabb1b69e010d8335 (commit)

Summary of changes:
 lib/RT/Scrip.pm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

- Log -----------------------------------------------------------------
commit b1185c6d62d75ffbd714cea7e769015db1864856
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Tue Feb 4 22:25:23 2020 +0800

    No need to add not existing templates on scrip serialization
    
    Templates in queues override global versions, thus it's ok to not have
    global versions if scrips are only for specific queues, in which case,
    $self->TemplateObj won't contain a valid template object.
    
    This is to eliminate warnings like below on serialization:
    
        out from RT::Scrip-example.com-22 to
    RT::Template=HASH(0x7fd5b7bcff60) is an invalid reference

diff --git a/lib/RT/Scrip.pm b/lib/RT/Scrip.pm
index e015bb39a4..b8edd295a5 100644
--- a/lib/RT/Scrip.pm
+++ b/lib/RT/Scrip.pm
@@ -1118,7 +1118,8 @@ sub FindDependencies {
 
     $deps->Add( out => $self->ScripConditionObj );
     $deps->Add( out => $self->ScripActionObj );
-    $deps->Add( out => $self->TemplateObj );
+    my $template = $self->TemplateObj;
+    $deps->Add( out => $template ) if $template->Id;
 }
 
 sub __DependsOn {

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


More information about the rt-commit mailing list