summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authorByron Jones <glob@mozilla.com>2015-08-12 06:09:40 +0200
committerByron Jones <glob@mozilla.com>2015-08-12 06:09:40 +0200
commit397050be29b557b3312094e325396849e86036eb (patch)
tree13b7cbf6e72d9b0e316ffd95ff70aeecbb906a2f /extensions
parent98503a61f92093a81a0c32615000ac0f9e9f6ccb (diff)
downloadbugzilla-397050be29b557b3312094e325396849e86036eb.tar.gz
bugzilla-397050be29b557b3312094e325396849e86036eb.tar.xz
Bug 1193590 - Warning about obsolete patches on an unassigned bug
Diffstat (limited to 'extensions')
-rw-r--r--extensions/BMO/Extension.pm5
-rw-r--r--extensions/BMO/template/en/default/hook/attachment/list-warnings.html.tmpl2
-rw-r--r--extensions/BMO/template/en/default/hook/bug_modal/attachments-warnings.html.tmpl2
3 files changed, 5 insertions, 4 deletions
diff --git a/extensions/BMO/Extension.pm b/extensions/BMO/Extension.pm
index a72cc3cab..63f53bc06 100644
--- a/extensions/BMO/Extension.pm
+++ b/extensions/BMO/Extension.pm
@@ -66,7 +66,7 @@ BEGIN {
*Bugzilla::Bug::last_closed_date = \&_last_closed_date;
*Bugzilla::Bug::reporters_hw_os = \&_bug_reporters_hw_os;
*Bugzilla::Bug::is_unassigned = \&_bug_is_unassigned;
- *Bugzilla::Bug::has_patch = \&_bug_has_patch;
+ *Bugzilla::Bug::has_current_patch = \&_bug_has_current_patch;
*Bugzilla::Product::default_security_group = \&_default_security_group;
*Bugzilla::Product::default_security_group_obj = \&_default_security_group_obj;
*Bugzilla::Product::group_always_settable = \&_group_always_settable;
@@ -805,9 +805,10 @@ sub _bug_is_unassigned {
return $assignee eq 'nobody@mozilla.org' || $assignee =~ /\.bugs$/;
}
-sub _bug_has_patch {
+sub _bug_has_current_patch {
my ($self) = @_;
foreach my $attachment (@{ $self->attachments }) {
+ next if $attachment->isobsolete;
return 1 if
$attachment->ispatch
|| $attachment->contenttype eq 'text/x-github-pull-request'
diff --git a/extensions/BMO/template/en/default/hook/attachment/list-warnings.html.tmpl b/extensions/BMO/template/en/default/hook/attachment/list-warnings.html.tmpl
index 11998e12f..bc4480084 100644
--- a/extensions/BMO/template/en/default/hook/attachment/list-warnings.html.tmpl
+++ b/extensions/BMO/template/en/default/hook/attachment/list-warnings.html.tmpl
@@ -8,7 +8,7 @@
[%
RETURN UNLESS user.in_group('editbugs');
- RETURN UNLESS bug.attachments.size && bug.is_unassigned && bug.has_patch;
+ RETURN UNLESS bug.attachments.size && bug.is_unassigned && bug.has_current_patch;
%]
<tr class="bz_attach_footer">
<td colspan="[% show_attachment_flags ? 3 : 2 %]" id="unassigned_with_patches">
diff --git a/extensions/BMO/template/en/default/hook/bug_modal/attachments-warnings.html.tmpl b/extensions/BMO/template/en/default/hook/bug_modal/attachments-warnings.html.tmpl
index ca2a5a58c..b00eabc1f 100644
--- a/extensions/BMO/template/en/default/hook/bug_modal/attachments-warnings.html.tmpl
+++ b/extensions/BMO/template/en/default/hook/bug_modal/attachments-warnings.html.tmpl
@@ -8,7 +8,7 @@
[%
RETURN UNLESS user.in_group('editbugs');
- RETURN UNLESS bug.attachments.size && bug.is_unassigned && bug.has_patch;
+ RETURN UNLESS bug.attachments.size && bug.is_unassigned && bug.has_current_patch;
%]
<div id="unassigned_with_patches">
<img src="extensions/BMO/web/images/sign_warning.png" width="16" height="16">