query.cgi associates wrong components with products if at least one product has no component

RESOLVED FIXED in Bugzilla 3.0

Status

()

Bugzilla
Query/Bug List
--
major
RESOLVED FIXED
11 years ago
11 years ago

People

(Reporter: Frédéric Buclin, Assigned: wicked)

Tracking

({regression})

2.23.4
Bugzilla 3.0
regression
Bug Flags:
approval +
blocking3.0 -

Details

Attachments

(1 attachment)

(Reporter)

Description

11 years ago
If a product has no component, query.cgi associates wrong components with products. That's a regression due to bug 312876 where the JS code lists *all* selectable products while the dropdown menu only lists selectable products having at least one component. As the JS code uses the index of the item in the product list instead of the name of the product itself, all associations are shifted by at least one.
Flags: blocking3.0?
(Reporter)

Comment 1

11 years ago
The best fix I can imagine for this bug is to backout bug 312876. If we fix it when useclassification is turned off, I'm almost sure it will break when we turn it on again (because some counters are incremented even when the product has no component, so we have missing indexes). ;)

Comment 2

11 years ago
This isn't a blocker, because products with no components is a really dumb thing to do (and easy to work around). But yes, at this stage perhaps the best solution is to back out that patch.
Flags: blocking3.0? → blocking3.0-
(Assignee)

Comment 3

11 years ago
Created attachment 255773 [details] [diff] [review]
Simple fix to JS Array contents, V1

Here's a patch that fixes JS Arrays to contain only components, versions and milestones for products that have components. These are the only products that are selectable because the product select box only contain such products.

I tested this with and without classifications and it seems to do the trick. With classifications turned on the JS code used stored indexes for product based data so the counting problem did not occur.
Assignee: query-and-buglist → wicked+bz
Status: NEW → ASSIGNED
Attachment #255773 - Flags: review?
(Reporter)

Comment 4

11 years ago
Comment on attachment 255773 [details] [diff] [review]
Simple fix to JS Array contents, V1

works fine. r=LpSolit
Attachment #255773 - Flags: review? → review+
(Reporter)

Updated

11 years ago
Flags: approval+
(Reporter)

Comment 5

11 years ago
Checking in template/en/default/search/form.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/search/form.html.tmpl,v  <--  form.html.tmpl
new revision: 1.47; previous revision: 1.46
done
Status: ASSIGNED → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.