From 52cbd16ef02a1098249758e30d12fc314926f3ef Mon Sep 17 00:00:00 2001 From: Simon Green Date: Thu, 26 Sep 2013 12:13:18 +1000 Subject: Bug 769134 - Bugzilla unintentionally removes groups when changing products with multiple bugs r=dkl, a=justdave --- Bugzilla/Bug.pm | 4 ++ .../bug/process/verify-new-product.html.tmpl | 71 ++++++++++++++++++---- 2 files changed, 62 insertions(+), 13 deletions(-) diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index ba941788b..4d2421a59 100644 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -2556,6 +2556,10 @@ sub _set_product { OR gcm.othercontrol != ?) )', undef, (@idlist, $product->id, CONTROLMAPNA, CONTROLMAPNA)); $vars{'old_groups'} = Bugzilla::Group->new_from_list($gids); + + # Did we come here from editing multiple bugs? (affects how we + # show optional group changes) + $vars{multiple_bugs} = Bugzilla->cgi->param('id') ? 0 : 1; } if (%vars) { diff --git a/template/en/default/bug/process/verify-new-product.html.tmpl b/template/en/default/bug/process/verify-new-product.html.tmpl index 77471cbcd..c712ae09a 100644 --- a/template/en/default/bug/process/verify-new-product.html.tmpl +++ b/template/en/default/bug/process/verify-new-product.html.tmpl @@ -140,19 +140,64 @@ [% IF optional_groups.size %]

These groups are optional. You can decide to restrict [% terms.bugs %] to one or more of the following groups:
- [% FOREACH group = optional_groups %] - - - -
+ [% IF multiple_bugs %] + [% USE Bugzilla %] + + + + + + + + + + [% FOREACH group = optional_groups %] + + + + + + + + [% END %] + +
Remove
[% terms.bugs %]
from this
group
Add
[% terms.bugs %]
to this
group
Group Name:
+ + + + + [% group.group.description FILTER html %] +
+ [% ELSE %] + [% FOREACH group = optional_groups %] + + + +
+ [% END %] [% END %]

[% END %] -- cgit v1.2.3-24-g4f1b