Closed Bug 97966 Opened 23 years ago Closed 22 years ago

Query JS nukes old selections.

Categories

(Bugzilla :: Query/Bug List, defect, P1)

2.15
defect

Tracking

()

RESOLVED FIXED
Bugzilla 2.16

People

(Reporter: CodeMachine, Assigned: kiko)

References

Details

Attachments

(1 file, 3 obsolete files)

When you add a product to or remove a product from the products field on the
query page, the old selections for components/versions/milestones are nuked. 
You should save and restore them.
Priority: -- → P2
Target Milestone: --- → Bugzilla 2.16
Matthew, I have a patch in hand for this, but I am waiting for review on
bug 83033 so the basic idea is approved. It's not a bad fix, and it
makes things much better for us. I'll post a repatch as soon at the
other patch has been decided on / or checked in.
Status: NEW → ASSIGNED
When 83033 goes in this is a one-liner or so.
Depends on: 83033
This is going to be a blocker for the 2.16 release
Severity: normal → blocker
Priority: P2 → P1
Filed cleanup bug that will make this much easier (provides a convenience
function for restoring selection, too, which is essential).
Depends on: 122154
No longer depends on: 83033
This patch probably fixes bug 83033 too. I chose to implement differently than
Myk; I save and restore selections outside of updateSelect(), to provide this
as an optional feature to anybody who wants to use the API (updateSelect() is
rather generic; it adds options into select controls).

Myk, does this look ok, or should I use your approach?
Keywords: patch, review
Comment on attachment 67551 [details] [diff] [review]
kiko_v1: fix bug. no JS warnings.

>===================================================================
>RCS file: /cvsroot/mozilla/webtools/bugzilla/template/default/query/query.atml,v
>retrieving revision 1.4
>diff -u -r1.4 query.atml
>--- query.atml	2002/02/01 14:52:37	1.4
>+++ query.atml	2002/02/02 03:03:15

>   #    - findall: boolean, dumping all options if all or just the selected 
>+  #    - values: boolean, save values or indexes

This comment could be clearer.	Explicitly say which one is true and which is
false, and could you do the same for the findall var above it too?

...
>+            if (values) {
>+                ret[ret.length] = control.options[i].value;
>+            } else {
>+                ret[ret.length] = i;
>+            }

Blah.  Just use:

   ret[ret.length] = values ? control.options[i].value : i;

...

>     if (f.product.selectedIndex == -1) {
>-        sel = getSelection(f.product, true);
>+        sel = getSelection(f.product, true, false);
>     } else {
>-        sel = getSelection(f.product, false);
>+        sel = getSelection(f.product, false, false);

I think the above would be better written like this:

      var findall = (f.product.selectedIndex == -1);
      sel = getSelection(f.product, findall, false);
      if (!findall) {
	  ....


Other than that it looks fine.	I don't have a bugzilla install to test this on
though, so 2nd reviewer will have to test this

r=caillon with those fixes made.
All comments accepted.
Attachment #51918 - Attachment is obsolete: true
Attachment #67551 - Attachment is obsolete: true
Comment on attachment 67600 [details] [diff] [review]
kiko_v2: fix per caillon's comments. no JS warnings.

r=caillon
Attachment #67600 - Flags: review+
Oops. No warnings now. :)
Attachment #67600 - Attachment is obsolete: true
Comment on attachment 67892 [details] [diff] [review]
kiko_v3: fix tiny comment bug

r=caillon from the comment.
Attachment #67892 - Flags: review+
Comment on attachment 67892 [details] [diff] [review]
kiko_v3: fix tiny comment bug

still doesn't work.

I selected one item in each of Product, Component, Version, and Target
Milestone, and submitted my query.  After getting a buglist, I clicked the Back
button.  My milestone choice was retained, but the component and version
choices were both gone.
Attachment #67892 - Flags: review-
Dave: where in this bug is the back button mentioned? That's bug 83033 :-)
Please let this go in and I'll adapt to the problems we are seeing with it.
Comment on attachment 67892 [details] [diff] [review]
kiko_v3: fix tiny comment bug

doh, you're right.

r= justdave

This does fix THIS bug. :-)
Attachment #67892 - Flags: review- → review+
Checking in template/default/query/query.atml;
/cvsroot/mozilla/webtools/bugzilla/template/default/query/query.atml,v  <-- 
query.atml
new revision: 1.5; previous revision: 1.4
done
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
*** Bug 144313 has been marked as a duplicate of this bug. ***
When can this change be made in Bugscape? 
Susie, you should ask shiva that question.  He's responsible for upgrading the
Bugscape server.
QA Contact: matty_is_a_geek → default-qa
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: