aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbbaetz%student.usyd.edu.au <>2002-08-12 12:42:42 +0000
committerbbaetz%student.usyd.edu.au <>2002-08-12 12:42:42 +0000
commit61ddf0a32846fdf2607043d94af1a0a86b80f6fc (patch)
tree714517b4c6b9e33b10a12aa5a4b99641bcafefef /duplicates.cgi
parentBug 162217: fixed my bustage introduced in bug 160410; yes, I owe the whole B... (diff)
downloadbugzilla-61ddf0a32846fdf2607043d94af1a0a86b80f6fc.tar.gz
bugzilla-61ddf0a32846fdf2607043d94af1a0a86b80f6fc.tar.bz2
bugzilla-61ddf0a32846fdf2607043d94af1a0a86b80f6fc.zip
Bug 43600 - Convert products/components to use ids instead of names.
Initial attempt by jake@bugzilla.org, updated by me r=joel, preed
Diffstat (limited to 'duplicates.cgi')
-rwxr-xr-xduplicates.cgi24
1 files changed, 17 insertions, 7 deletions
diff --git a/duplicates.cgi b/duplicates.cgi
index 3d0875313..715b4be28 100755
--- a/duplicates.cgi
+++ b/duplicates.cgi
@@ -62,6 +62,15 @@ my $product = formvalue("product");
my $sortvisible = formvalue("sortvisible");
my @buglist = (split(/[:,]/, formvalue("bug_id")));
+my $product_id;
+if ($product) {
+ $product_id = get_product_id($product);
+ if (!$product_id) {
+ ThrowUserError("The product <tt>" . html_quote($product) .
+ "</tt> does not exist");
+ }
+}
+
# Small backwards-compatibility hack, dated 2002-04-10.
$sortby = "count" if $sortby eq "dup_count";
@@ -143,16 +152,17 @@ if (scalar(%count)) {
# WONTFIX. We want to see VERIFIED INVALID and WONTFIX because common
# "bugs" which aren't bugs end up in this state.
my $query = "
- SELECT bugs.bug_id, component, bug_severity, op_sys, target_milestone,
- short_desc, bug_status, resolution
- FROM bugs
- WHERE (bug_status != 'CLOSED')
- AND ((bug_status = 'VERIFIED' AND resolution IN ('INVALID', 'WONTFIX'))
+ SELECT bugs.bug_id, components.name, bug_severity, op_sys,
+ target_milestone, short_desc, bug_status, resolution
+ FROM bugs, components
+ WHERE (bugs.component_id = components.id)
+ AND (bug_status != 'CLOSED')
+ AND ((bug_status = 'VERIFIED' AND resolution IN ('INVALID', 'WONTFIX'))
OR (bug_status != 'VERIFIED'))
AND bugs.bug_id IN (" . join(", ", keys %count) . ")";
- # Limit to a single product if requested
- $query .= (" AND product = " . SqlQuote($product)) if $product;
+ # Limit to a single product if requested
+ $query .= (" AND bugs.product_id = " . $product_id) if $product_id;
SendSQL(SelectVisible($query,
$userid,