After the first entry to query.cgi the sorting order of "target milestones" is correct (according to sort keys), but after choosing any product "target milestone" select box is reloaded and the order of the values there is not according to sort keys anymore. Steps to reproduce: 1) create a dummy project "dummy" 2) create two target milestones: - "target a" with sort key 2 - "target b" with sort key 1 3) enter query.cgi page (target milestones are listed in order: "target b", "target a") 4) click on the project "dummy" (target milestones are listed in order: "target a", "target b")
Created attachment 141150 [details] [diff] [review] Patch to query.cgi (v2.17.6) to fix problem Warning: this is my first patch submitted to bugzilla. I'm not certain I've got the proper format.
I experienced this problem in 2.17.6 in our local installation. It appears that the code that is initializing the per-product list of target milestones is unnecessarily doing a sort (near line 265 in 2.17.6 version of query.cgi). Removing this sort will cause the target milestones to be stored in the order they appear in %::target_milestone.
format of the patch looks good (it's diff -u). I know Matty had ideas for the milestone stuff, so I'll let him judge if this is doing the right thing.
Yeah, but the problem is that when reinsering the items into the select box (for instance, when you control-click another product) they go in out of order, because of the internal sorting done in the query.cgi JS. Gerv has a plan to fix this over at bug 173583, though he hasn't had the guts to try it yet. I'm duping this bug over to that one just because it has more relevant discussion, IMO. Ken, if you have some time free, we could really use some help to get this done the right way. *** This bug has been marked as a duplicate of 173583 ***
Comment on attachment 141150 [details] [diff] [review] Patch to query.cgi (v2.17.6) to fix problem For the record, this breaks for multiple selections in the product list.