Commit c1e422c6 authored by jocuri%softhome.net's avatar jocuri%softhome.net

Bug 221900: duplicates.cgi query fails if more than one product selected; patch…

Bug 221900: duplicates.cgi query fails if more than one product selected; patch by chaduv <caduvall@glue.umd.edu>; r=gerv; a=justdave.
parent d7f41e15
......@@ -78,16 +78,16 @@ my $changedsince = formvalue("changedsince", 7);
my $maxrows = formvalue("maxrows", 100);
my $openonly = formvalue("openonly");
my $reverse = formvalue("reverse") ? 1 : 0;
my $product = formvalue("product");
my @query_products = $cgi->param('product');
my $sortvisible = formvalue("sortvisible");
my @buglist = (split(/[:,]/, formvalue("bug_id")));
my $product_id;
if ($product) {
$product_id = get_product_id($product);
foreach my $p (@query_products) {
$product_id = get_product_id($p);
if (!$product_id) {
ThrowUserError("invalid_product_name",
{ product => $product });
{ product => $p });
}
}
......@@ -209,7 +209,7 @@ if (scalar(%count)) {
# Restrict to product if requested
if ($::FORM{'product'}) {
$params->param('product', $::FORM{'product'});
$params->param('product', join(',', @query_products));
}
my $query = new Bugzilla::Search('fields' => [qw(bugs.bug_id
......@@ -258,7 +258,7 @@ $vars->{'maxrows'} = $maxrows;
$vars->{'openonly'} = $openonly;
$vars->{'reverse'} = $reverse;
$vars->{'format'} = $::FORM{'format'};
$vars->{'product'} = $product;
$vars->{'query_products'} = \@query_products;
$vars->{'products'} = \@::legal_product;
......
......@@ -39,7 +39,7 @@
# maxrows: integer. Max number of rows to display.
# changedsince: integer. The number of days ago for the changedsince column.
# openonly: boolean. True if we are only showing open bugs.
# product: string. Restrict to this product only.
# query_products: list of strings. Restrict to these products only.
#%]
[% PROCESS global/variables.none.tmpl %]
......@@ -78,7 +78,7 @@
[% "&amp;maxrows=$maxrows" IF maxrows %]
[% "&amp;changedsince=$changedsince" IF changedsince %]
[% "&amp;openonly=1" IF openonly %]
[% IF product %]&amp;product=[% product FILTER html %][% END %]
[% FOREACH p = query_products %]&amp;product=[% p FILTER html %][% END %]
[% IF format %]&amp;format=[% format FILTER html %][% END %]
[% "&amp;bug_id=$bug_ids_string&amp;sortvisible=1"
IF sortvisible %]">
......
......@@ -27,7 +27,7 @@
# maxrows: integer. Max number of rows to display.
# changedsince: integer. The number of days ago for the changedsince column.
# openonly: boolean. True if we are only showing open bugs.
# product: string. Restrict to this product only.
# query_products: list of strings. The set of products we check for dups.
#
# Additionally, you need to fulfill the interface to
# duplicates-table.html.tmpl.
......@@ -35,8 +35,8 @@
[% PROCESS global/variables.none.tmpl %]
[% IF product %]
[% title = "Most Frequently Reported $terms.Bugs for $product" %]
[% IF query_products.size %]
[% title = "Most Frequently Reported $terms.Bugs for ${query_products.join(', ')}" %]
[% ELSE %]
[% title = "Most Frequently Reported $terms.Bugs" %]
[% END%]
......@@ -85,7 +85,8 @@
<select name="product" size="5" multiple="multiple">
[% FOREACH p = products %]
<option name="[% p FILTER html %]"
[% " selected" IF product == p %]>[% p FILTER html %]</option>
[% " selected" IF lsearch(query_products, p) != -1 %]
>[% p FILTER html %]</option>
[% END %]
</select>
</td>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment