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
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>
-rw-r--r--Bugzilla/Constants.pm2
-rw-r--r--Bugzilla/Hook.pm15
-rw-r--r--Bugzilla/Template.pm1
-rwxr-xr-xcontrib/jb2bz.py3
-rw-r--r--extensions/Example/Extension.pm13
-rw-r--r--template/en/default/list/list.html.tmpl2
6 files changed, 33 insertions, 3 deletions
diff --git a/Bugzilla/Constants.pm b/Bugzilla/Constants.pm
index a6516774b..7c387c82e 100644
--- a/Bugzilla/Constants.pm
+++ b/Bugzilla/Constants.pm
@@ -200,7 +200,7 @@ use Memoize;
# CONSTANTS
#
# Bugzilla version
-use constant BUGZILLA_VERSION => "5.0.4";
+use constant BUGZILLA_VERSION => "5.0.4+";
# A base link to the current REST Documentation. We place it here
# as it will need to be updated to whatever the current release is.
diff --git a/Bugzilla/Hook.pm b/Bugzilla/Hook.pm
index d6ba5e1d0..d8ae67463 100644
--- a/Bugzilla/Hook.pm
+++ b/Bugzilla/Hook.pm
@@ -1479,6 +1479,21 @@ look at the code for C<create> in L<Bugzilla::Template>.)
=back
+=head2 template_after_create
+
+This hook allows you to manipulate the Template object before it is used.
+You can use this to define new vmethods or filters in extensions.
+
+Params:
+
+=over
+
+=item C<template>
+
+This is the L<Bugzilla::Template> object.
+
+=back
+
=head2 template_before_process
This hook is called any time Bugzilla processes a template file, including
diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm
index 463d38620..48270b129 100644
--- a/Bugzilla/Template.pm
+++ b/Bugzilla/Template.pm
@@ -1198,6 +1198,7 @@ sub create {
Bugzilla::Hook::process('template_before_create', { config => $config });
my $template = $class->new($config)
|| die("Template creation failed: " . $class->error());
+ Bugzilla::Hook::process('template_after_create', { template => $template });
# Pass on our current language to any template hooks or inner templates
# called by this Template object.
diff --git a/contrib/jb2bz.py b/contrib/jb2bz.py
index caaa0c5e2..170e82d70 100755
--- a/contrib/jb2bz.py
+++ b/contrib/jb2bz.py
@@ -30,7 +30,7 @@ if not mimetypes.encodings_map.has_key('.bz2'):
bug_status='CONFIRMED'
component="default"
-version=""
+version="unspecified"
product="" # this is required, the rest of these are defaulted as above
"""
@@ -230,6 +230,7 @@ def process_jitterbug(filename):
"bug_id=%s," \
"priority='---'," \
"bug_severity='normal'," \
+ "op_sys='All'," \
"bug_status=%s," \
"creation_ts=%s," \
"delta_ts=%s," \
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) = @_;
diff --git a/template/en/default/list/list.html.tmpl b/template/en/default/list/list.html.tmpl
index 368cd9c08..d34a454e0 100644
--- a/template/en/default/list/list.html.tmpl
+++ b/template/en/default/list/list.html.tmpl
@@ -250,7 +250,7 @@
[% IF bugowners && user.id %]
<button type="button" id="email_assignees"
- onclick="document.location='mailto:[% bugowners FILTER html %]'">
+ onclick="document.location='mailto:[% bugowners FILTER html FILTER js %]'">
Send Mail to [% terms.Bug %] Assignees</button>
[% END %]