summaryrefslogtreecommitdiffstats
path: root/bug_form.pl
diff options
context:
space:
mode:
Diffstat (limited to 'bug_form.pl')
-rw-r--r--bug_form.pl14
1 files changed, 11 insertions, 3 deletions
diff --git a/bug_form.pl b/bug_form.pl
index 65c7b41c1..fb6a60112 100644
--- a/bug_form.pl
+++ b/bug_form.pl
@@ -77,19 +77,27 @@ sub show_bug {
# Populate the bug hash with the info we get directly from the DB.
my $query = "
- SELECT bugs.bug_id, alias, product, version, rep_platform,
+ SELECT bugs.bug_id, alias, products.name, version, rep_platform,
op_sys, bug_status, resolution, priority,
- bug_severity, component, assigned_to, reporter,
+ bug_severity, components.name, assigned_to, reporter,
bug_file_loc, short_desc, target_milestone,
qa_contact, status_whiteboard,
date_format(creation_ts,'%Y-%m-%d %H:%i'),
groupset, delta_ts, sum(votes.count)
- FROM bugs LEFT JOIN votes USING(bug_id)
+ FROM bugs LEFT JOIN votes USING(bug_id), products, components
WHERE bugs.bug_id = $id
+ AND bugs.product_id = products.id
+ AND bugs.component_id = components.id
GROUP BY bugs.bug_id";
SendSQL($query);
+ # The caller is meant to have checked this. Abort here so that
+ # we don't get obscure SQL errors, below
+ if (!MoreSQLData()) {
+ ThrowCodeError("No data when fetching bug $id");
+ }
+
my $value;
my @row = FetchSQLData();
foreach my $field ("bug_id", "alias", "product", "version", "rep_platform",