[Rt-commit] rt branch, 4.2/simple-template-cf, created. rt-4.2.3-172-g561bf1a
Alex Vandiver
alexmv at bestpractical.com
Wed Apr 30 19:17:42 EDT 2014
The branch, 4.2/simple-template-cf has been created
at 561bf1a939559a1b81635a2dbf6f40f51b03e6ea (commit)
- Log -----------------------------------------------------------------
commit 561bf1a939559a1b81635a2dbf6f40f51b03e6ea
Author: Alex Vandiver <alexmv at bestpractical.com>
Date: Wed Apr 30 19:17:32 2014 -0400
Strip non-word characters from CF names for variable names
Fixes I#18446.
diff --git a/lib/RT/Template.pm b/lib/RT/Template.pm
index 3831f4f..f0a58c6 100644
--- a/lib/RT/Template.pm
+++ b/lib/RT/Template.pm
@@ -640,7 +640,10 @@ sub _MassageSimpleTemplateArgs {
my $cfs = $ticket->CustomFields;
while (my $cf = $cfs->Next) {
- $template_args->{"TicketCF" . $cf->Name} = $ticket->CustomFieldValuesAsString($cf->Name);
+ my $simple = $cf->Name;
+ $simple =~ s/\W//g;
+ $template_args->{"TicketCF" . $simple}
+ = $ticket->CustomFieldValuesAsString($cf->Name);
}
}
@@ -651,7 +654,10 @@ sub _MassageSimpleTemplateArgs {
my $cfs = $txn->CustomFields;
while (my $cf = $cfs->Next) {
- $template_args->{"TransactionCF" . $cf->Name} = $txn->CustomFieldValuesAsString($cf->Name);
+ my $simple = $cf->Name;
+ $simple =~ s/\W//g;
+ $template_args->{"TransactionCF" . $simple}
+ = $txn->CustomFieldValuesAsString($cf->Name);
}
}
}
-----------------------------------------------------------------------
More information about the rt-commit
mailing list