]> git.uio.no Git - usit-rt.git/blobdiff - lib/RT/ScripAction.pm
Master to 4.2.8
[usit-rt.git] / lib / RT / ScripAction.pm
index 901266c9d5b5a4035e479006ab6e0126cae913a7..883c169105872be964bb631d32ff90b440cf4c00 100644 (file)
@@ -2,7 +2,7 @@
 #
 # COPYRIGHT:
 #
-# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC
+# This software is Copyright (c) 1996-2014 Best Practical Solutions, LLC
 #                                          <sales@bestpractical.com>
 #
 # (Except where explicitly superseded by other copyright notices)
@@ -66,6 +66,7 @@ use warnings;
 
 use base 'RT::Record';
 
+
 sub Table {'ScripActions'}
 
 use RT::Template;
@@ -170,7 +171,7 @@ sub LoadAction  {
     my $module = $1;
     my $type = "RT::Action::". $module;
 
-    eval "require $type" || die "Require of $type failed.\n$@\n";
+    $type->require or die "Require of $type action module failed.\n$@\n";
 
     return $self->{'Action'} = $type->new(
         %args,
@@ -193,8 +194,8 @@ sub TemplateObj {
         Remove => "4.4",
     );
 
-    return undef unless $self->{Template};
     if ( !$self->{'TemplateObj'} ) {
+        return undef unless $self->{Template};
         $self->{'TemplateObj'} = RT::Template->new( $self->CurrentUser );
         $self->{'TemplateObj'}->Load( $self->{'Template'} );