aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2019-11-30 22:32:46 -0800
committerRobin H. Johnson <robbat2@gentoo.org>2019-11-30 22:32:46 -0800
commita3f0c531f2314836dee97abf9ff18122f04b0f05 (patch)
tree222f1de54d0c3a84dad3689a39a1413f36d223e1 /extensions
parentMerge branch 'master' into bugstest (diff)
parentBug 1226123 - Email addresses with an apostrophe in them break the "Send Mail... (diff)
downloadbugzilla-a3f0c531f2314836dee97abf9ff18122f04b0f05.tar.gz
bugzilla-a3f0c531f2314836dee97abf9ff18122f04b0f05.tar.bz2
bugzilla-a3f0c531f2314836dee97abf9ff18122f04b0f05.zip
Merge commit '3395d78cc8b0bd660e56f73a2689d495f2a22628' into bugstest
Merging in upstream changes incrementally. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Diffstat (limited to 'extensions')
-rw-r--r--extensions/Example/Extension.pm13
1 files changed, 13 insertions, 0 deletions
diff --git a/extensions/Example/Extension.pm b/extensions/Example/Extension.pm
index dbc84df72..c4fabe656 100644
--- a/extensions/Example/Extension.pm
+++ b/extensions/Example/Extension.pm
@@ -920,6 +920,19 @@ sub template_before_create {
$config->{VARIABLES}->{example_global_variable} = sub { return 'value' };
}
+sub template_after_create {
+ my ( $self, $args ) = @_;
+ my $context = $args->{template}->context;
+
+ # define a pluck method on template toolkit lists.
+ $context->define_vmethod(
+ list => pluck => sub {
+ my ( $list, $field ) = @_;
+ return [ map { $_->$field } @$list ];
+ }
+ );
+}
+
sub template_before_process {
my ($self, $args) = @_;