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

RESOLVED FIXED in Bugzilla 3.0



12 years ago
12 years ago


(Reporter: LpSolit, Assigned: wicked)



Bugzilla 3.0
Bug Flags:
approval +
blocking3.0 -



(1 attachment)



12 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?

Comment 1

12 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). ;)
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-

Comment 3

12 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
Attachment #255773 - Flags: review?

Comment 4

12 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+


12 years ago
Flags: approval+

Comment 5

12 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
Last Resolved: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.