summaryrefslogtreecommitdiff
path: root/rt/lib/RT/Template_Overlay.pm
diff options
context:
space:
mode:
authorivan <ivan>2005-10-15 09:11:20 +0000
committerivan <ivan>2005-10-15 09:11:20 +0000
commit673b9a458d9138523026963df6fa3b4683e09bae (patch)
tree42acc524ff5fd53e4fdb2f5b6dac4a42ce8057f6 /rt/lib/RT/Template_Overlay.pm
parent591613cf1c861505335646fff3ffb4a705e011bf (diff)
parentd4d0590bef31071e8809ec046717444b95b3f30a (diff)
This commit was generated by cvs2svn to compensate for changes in r4407,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'rt/lib/RT/Template_Overlay.pm')
-rw-r--r--rt/lib/RT/Template_Overlay.pm24
1 files changed, 19 insertions, 5 deletions
diff --git a/rt/lib/RT/Template_Overlay.pm b/rt/lib/RT/Template_Overlay.pm
index 877b5c422..bfff0f03e 100644
--- a/rt/lib/RT/Template_Overlay.pm
+++ b/rt/lib/RT/Template_Overlay.pm
@@ -1,8 +1,8 @@
-# {{{ BEGIN BPS TAGGED BLOCK
+# BEGIN BPS TAGGED BLOCK {{{
#
# COPYRIGHT:
#
-# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC
+# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
# <jesse@bestpractical.com>
#
# (Except where explicitly superseded by other copyright notices)
@@ -42,7 +42,7 @@
# works based on those contributions, and sublicense and distribute
# those contributions and any derivatives thereof.
#
-# }}} END BPS TAGGED BLOCK
+# END BPS TAGGED BLOCK }}}
# Portions Copyright 2000 Tobias Brox <tobix@cpan.org>
=head1 NAME
@@ -66,6 +66,9 @@ ok(require RT::Template);
=cut
+
+package RT::Template;
+
use strict;
no warnings qw(redefine);
@@ -321,10 +324,13 @@ sub MIMEObj {
# {{{ sub Parse
-=item Parse
+=head2 Parse
This routine performs Text::Template parsing on the template and then
imports the results into a MIME::Entity so we can really use it
+
+ Takes a hash containing Argument, TicketObj, and TransactionObj.
+
It returns a tuple of (val, message)
If val is 0, the message contains an error message
@@ -403,7 +409,15 @@ sub _ParseContent {
SOURCE => $content
);
- my $retval = $template->fill_in( PACKAGE => 'T' );
+ my $is_broken = 0;
+ my $retval = $template->fill_in( PACKAGE => 'T', BROKEN => sub {
+ my (%args) = @_;
+ $RT::Logger->error("Template parsing error: $args{error}")
+ unless $args{error} =~ /^Died at /; # ignore intentional die()
+ $is_broken++;
+ return undef;
+ } );
+ return undef if $is_broken;
# MIME::Parser has problems dealing with high-bit utf8 data.
Encode::_utf8_off($retval);