summaryrefslogtreecommitdiffstats
path: root/enter_bug.cgi
diff options
context:
space:
mode:
authorbbaetz%student.usyd.edu.au <>2002-08-12 14:42:42 +0200
committerbbaetz%student.usyd.edu.au <>2002-08-12 14:42:42 +0200
commit61ddf0a32846fdf2607043d94af1a0a86b80f6fc (patch)
tree714517b4c6b9e33b10a12aa5a4b99641bcafefef /enter_bug.cgi
parent17b301e76d886afd5be8f4e9919afb4446e49405 (diff)
downloadbugzilla-61ddf0a32846fdf2607043d94af1a0a86b80f6fc.tar.gz
bugzilla-61ddf0a32846fdf2607043d94af1a0a86b80f6fc.tar.xz
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 'enter_bug.cgi')
-rwxr-xr-xenter_bug.cgi10
1 files changed, 6 insertions, 4 deletions
diff --git a/enter_bug.cgi b/enter_bug.cgi
index 726179722..83f1126f9 100755
--- a/enter_bug.cgi
+++ b/enter_bug.cgi
@@ -239,7 +239,9 @@ if (lsearch(\@::enterable_products, $product) == -1) {
DisplayError("'" . html_quote($product) . "' is not a valid product.");
exit;
}
-
+
+my $product_id = get_product_id($product);
+
if (0 == @{$::components{$product}}) {
my $error = "Sorry; there needs to be at least one component for this " .
"product in order to create a new bug. ";
@@ -261,8 +263,8 @@ elsif (1 == @{$::components{$product}}) {
}
my @components;
-SendSQL("SELECT value, description FROM components " .
- "WHERE program = " . SqlQuote($product) . " ORDER BY value");
+SendSQL("SELECT name, description FROM components " .
+ "WHERE product_id = $product_id ORDER BY name");
while (MoreSQLData()) {
my ($name, $description) = FetchSQLData();
@@ -315,7 +317,7 @@ if (exists $::COOKIE{"VERSION-$product"} &&
my @status = "NEW";
if (UserInGroup("editbugs") || UserInGroup("canconfirm")) {
- SendSQL("SELECT votestoconfirm FROM products WHERE product = " .
+ SendSQL("SELECT votestoconfirm FROM products WHERE name = " .
SqlQuote($product));
push(@status, $unconfirmedstate) if (FetchOneColumn());
}