]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Fixes on checkin for bug 769134
authorFrédéric Buclin <LpSolit@gmail.com>
Fri, 11 Oct 2013 21:42:22 +0000 (23:42 +0200)
committerFrédéric Buclin <LpSolit@gmail.com>
Fri, 11 Oct 2013 21:42:22 +0000 (23:42 +0200)
Bugzilla/Bug.pm
template/en/default/bug/process/verify-new-product.html.tmpl

index 3000bd0aec0b59aa5de4b8fd752067b53d8971e1..2c0d458e731804126ff09aebee7e6f004046d54e 100644 (file)
@@ -2541,6 +2541,7 @@ sub _set_product {
             my @idlist = ($self->id);
             push(@idlist, map {$_->id} @{ $params->{other_bugs} })
                 if $params->{other_bugs};
+            @idlist = uniq @idlist;
             # Get the ID of groups which are no longer valid in the new product.
             my $gids = $dbh->selectcol_arrayref(
                 'SELECT bgm.group_id
@@ -2555,13 +2556,13 @@ sub _set_product {
                                         . Bugzilla->user->groups_as_string . '))
                                        OR gcm.othercontrol != ?) )',
                 undef, (@idlist, $product->id, CONTROLMAPNA, CONTROLMAPNA));
-            $vars{'old_groups'} = Bugzilla::Group->new_from_list($gids);            
+            $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;
+            $vars{multiple_bugs} = (@idlist > 1) ? 1 : 0;
         }
-        
+
         if (%vars) {
             $vars{product} = $product;
             $vars{bug} = $self;
index c712ae09ae5dd77662ef84f06406a435c88bed20..a1a9539f2214d19dfd009bed8207a963633b91de 100644 (file)
     <p>These groups are optional. You can decide to restrict [% terms.bugs %] to
     one or more of the following groups:<br>
     [% IF multiple_bugs %]
-      [% USE Bugzilla %]
       <script type="text/javascript">
         function turn_off(myself, id) {
             var other_checkbox = document.getElementById(id);
         [% FOREACH group = optional_groups %]
         <tr>
           <td align="center">
-            <input type="checkbox" name="defined_groups" 
+            <input type="checkbox" name="defined_groups"
                    id="defined_group_[% group.group.id FILTER html %]"
                    value="[% group.group.name FILTER html %]"
-                   [% IF Bugzilla.cgi.param("defined_groups").contains(group.group.name) %] checked="checked"[% END %]
+                   [% IF cgi.param("defined_groups").contains(group.group.name) %] checked="checked"[% END %]
                    onchange="turn_off(this, 'group_[% group.group.id FILTER html %]')">
           </td>
           <td align="center">
-            <input type="checkbox" name="groups" 
+            <input type="checkbox" name="groups"
                    id="group_[% group.group.id FILTER html %]"
                    value="[% group.group.name FILTER html %]"
-                   [% IF Bugzilla.cgi.param("groups").contains(group.group.name) %] checked="checked"[% END %]
+                   [% IF cgi.param("groups").contains(group.group.name) %] checked="checked"[% END %]
                    onchange="turn_off(this, 'defined_group_[% group.group.id FILTER html %]')">
           </td>
-
           <td>
             [% group.group.description FILTER html %]
           </td>
-
         </tr>
         [% END %]
-
       </table>
     [% ELSE %]
       [% FOREACH group = optional_groups %]