Closed
Bug 1191706
Opened 10 years ago
Closed 9 years ago
When editing flag types, components do not match the selected product when classifications are enabled
Categories
(Bugzilla :: Administration, task)
Tracking
()
RESOLVED
FIXED
Bugzilla 5.0
People
(Reporter: gdsotirov, Assigned: LpSolit)
References
()
Details
Attachments
(1 file, 3 obsolete files)
11.39 KB,
patch
|
dkl
:
review+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:39.0) Gecko/20100101 Firefox/39.0
Build ID: 20150630154324
Steps to reproduce:
1. Log into into a Bugzilla installation as an administrator;
2. Go to Administration -> Flags;
3. In "Product:" select a product;
4. Check the contents of "Component:" list.
Actual results:
List of components do not match the product that was selected. In fact, they belong to another product.
Expected results:
The list of components should match the selected product, just like on Advanced Search page.
Reporter | ||
Updated•10 years ago
|
Reporter | ||
Comment 1•10 years ago
|
||
This is what I get on Advanced Search page for a product in my installation.
Reporter | ||
Comment 2•10 years ago
|
||
And this is what I get on Administer Flag Types page for the same product in my installation. In fact, those are the components of another product.
Reporter | ||
Updated•10 years ago
|
Attachment #8644192 -
Attachment description: product_components_in_flag_types_list.png → Product components on Administer Flag Types page
Reporter | ||
Comment 3•10 years ago
|
||
It's the same on Edit Flag Type page and as a consequence if I try to create a flag for a specific component of the product, I get error "Product 'SlackPack' has no component named 'Applications'." (for example), so I'm not able to do so.
Assignee | ||
Comment 4•10 years ago
|
||
2 questions:
1) Is there any product in your installation which has no components at all? Newer Bugzilla versions forbid this, but older ones allowed products to have no components, and this was the reason why this problem happened in the past.
2) Can you reproduce the issue if classifications are disabled?
Assignee: ui → administration
Component: User Interface → Administration
Reporter | ||
Comment 5•9 years ago
|
||
I'm sorry for the delay of my answer, but strangely I haven't received any mail for your comment. Anyway, here are the answers:
1) No, even though my installation is quite old (about 10 years and going). Here's the prove:
mysql> select P.name from products P left outer join components C on C.product_id = P.id where C.id is null;
Empty set (0,00 sec)
2) No, I couldn't, so that's a catch. With useclassification set to off the problem doesn't reproduce itself. The list of components for all products is correct. Switching the parameter on again brings back the unexpected result from bug's description.
Hope that helps and if there's anything else I could help hunt this bug down just let me know.
Assignee | ||
Comment 6•9 years ago
|
||
I can reproduce when classifications are enabled.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: Components do not match selected product in Administer Flag Types and Edit Flag Type pages → When editing flag types, components do not match the selected product when classifications are enabled
Target Milestone: --- → Bugzilla 5.0
Assignee | ||
Comment 7•9 years ago
|
||
The problem comes from global/js-products.html.tmpl which totally ignores classifications. This means that products are listed in a different order than in the <select> list, and so indexes do not match.
Assignee | ||
Comment 8•9 years ago
|
||
This fixes the problem with classifications, but I want to investigate why we have:
var useclassification = false; // No classification level in use
at the top of the template. Either this variable must be set to true, or it's useless and it must be killed (and its corresponding code in js/productform.js removed).
Also, this code is duplicated in request/queue.html.tmpl. I will check if we can refactor it to use global/js-products.html.tmpl.
Assignee: administration → LpSolit
Attachment #8644189 -
Attachment is obsolete: true
Attachment #8644192 -
Attachment is obsolete: true
Status: NEW → ASSIGNED
Assignee | ||
Comment 9•9 years ago
|
||
The useclassification variable in the JS code is no longer used since Bugzilla 4.4, see bug 636416, and so can safely go away. This same bug removed code related to versions and milestones too, and so I removed dead code from selectProduct() as well.
I also refactored request/queue.html.tmpl to use the same code as flagtypes, aka global/js-products.html.tmpl. This means much less JS code in templates, which is a good thing.
And finally, I fixed both editflagtypes.cgi and request.cgi to correctly take classifications into account.
Attachment #8702068 -
Attachment is obsolete: true
Attachment #8702965 -
Flags: review?(dkl)
Comment 10•9 years ago
|
||
Comment on attachment 8702965 [details] [diff] [review]
patch, v1
Review of attachment 8702965 [details] [diff] [review]:
-----------------------------------------------------------------
r=dkl
Attachment #8702965 -
Flags: review?(dkl) → review+
Updated•9 years ago
|
Flags: approval5.0+
Assignee | ||
Comment 11•9 years ago
|
||
To ssh://gitolite3@git.mozilla.org/bugzilla/bugzilla.git
9f5a8a2..f709156 master -> master
To ssh://gitolite3@git.mozilla.org/bugzilla/bugzilla.git
26a693a..04004a6 5.0 -> 5.0
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•