Closed
Bug 66235
Opened 24 years ago
Closed 23 years ago
process_bug.cgi: multiple product change misses the groupset bit
Categories
(Bugzilla :: Bugzilla-General, defect, P1)
Bugzilla
Bugzilla-General
Tracking
()
RESOLVED
FIXED
Bugzilla 2.14
People
(Reporter: tengel, Assigned: myk)
References
()
Details
Attachments
(7 files)
947 bytes,
patch
|
Details | Diff | Splinter Review | |
5.39 KB,
patch
|
Details | Diff | Splinter Review | |
8.24 KB,
patch
|
Details | Diff | Splinter Review | |
7.11 KB,
patch
|
Details | Diff | Splinter Review | |
13.38 KB,
patch
|
Details | Diff | Splinter Review | |
12.54 KB,
patch
|
Details | Diff | Splinter Review | |
13.21 KB,
patch
|
Details | Diff | Splinter Review |
When mass editing multiple bugs, the process_bug.cgi script changes the product name (ane components) from the old to the new, but it fails to set the 'groupset' bit to the new product's group bit. There are several places to fix it, I added the following right around line 359/360 (from v2.10, inside the "foreach my $field..." loop): if (defined $::FORM{'product'}) { my $name = trim($::FORM{'product'}); if (($name ne $::dontchange) && ($name ne "")) { ConnectToDatabase(); SendSQL("select bit from groups where name = '$name'"); my $bit = FetchOneColumn(); if (defined $bit) { DoComma(); $::query .= "groupset = $bit"; } } }
Updated•23 years ago
|
Target Milestone: --- → Bugzilla 2.14
Assignee | ||
Updated•23 years ago
|
Whiteboard: code
Comment 1•23 years ago
|
||
I'm willing to take this one if someone tells me kindly if troy's approach is the better one (special-casing product inside the loops) or if I should break the loop in a separate way. If nobody complains I'll follow Troy's suggestion.
Comment 3•23 years ago
|
||
Comment 4•23 years ago
|
||
I've added an attachment with the change. Troy, do you see anywhere else this has to be fixed? Apparently this is the only place.
Reporter | ||
Comment 5•23 years ago
|
||
No other places that I know of need it, this is the only one.
Comment 6•23 years ago
|
||
Not sure how all this works, but does the old product flag drop off, and should it?
Updated•23 years ago
|
Priority: -- → P1
Comment 7•23 years ago
|
||
This patch does no checking to find out whether the old bit was set or not, and it does nothing to preserve non-product group bits. I wouldn't bother fixing it though, since, as noted, it's going to break when bug 68022 is resolved.
Comment 8•23 years ago
|
||
I believe this is fixed by the patch on bug 84714, or at least sufficiently so that the user has the power to do something about it... (bug 84714's patch enables changing groups on mass-changes)
Comment 9•23 years ago
|
||
hmm, no this won't be fixed by the patch on bug 84714... what needs to happen is on a product change, check to see if the product group bit is set, and if so, clear it, and set the product group bit for the product the bug is moving to, if the new product has a group. What gets into a gray area is what do we do if the origin product doesn't have a group and the destination product does?
Reporter | ||
Comment 10•23 years ago
|
||
Well, the initial intent (by me, the user) was to move mass amounts of bugs from one group to the next (e.g., into an "Archives" group for old stuff). At this point, I'm not really sure it matters if the origin group was empty or not, as the destination is supposed to be set to the group I choose. Perhaps I'm missing something (most likely), but it seems to be a straightforward move from A -> B, regardless of A ?
Assignee | ||
Comment 11•23 years ago
|
||
This is another of those 2.14 milestone bugs that were depending on 68022, which has jumped to the 2.16 milestone. This bug needs to either be decoupled from that bug (and thus fixed in this milestone) or moved forward. If it stays in this milestone, Christian are you still willing and able to work on it or do you want someone else to take it over?
Assignee | ||
Comment 12•23 years ago
|
||
>What gets into a gray
>area is what do we do if the origin product doesn't have a group and the
>destination product does?
When a new bug is created, it gets placed into its product's group by default.
I imagine, then, that if a bug is moved from one product to another, it will be
placed into the new product's group by default as well. The only exceptions to
this are if the user doesn't have access to the new product's group or if they
explicitly request that the bug not be moved.
Assignee | ||
Comment 13•23 years ago
|
||
I'm working on a fix for this. -> over to myself.
Assignee: tara → myk
Assignee | ||
Comment 14•23 years ago
|
||
Assignee | ||
Comment 15•23 years ago
|
||
Assignee | ||
Updated•23 years ago
|
Assignee | ||
Comment 16•23 years ago
|
||
hmm, my solution has some problems. working on a new one.
Assignee | ||
Comment 17•23 years ago
|
||
Assignee | ||
Updated•23 years ago
|
Comment 18•23 years ago
|
||
Multiline if() statements complete with comments... I've never seen that before. Is that why the comments inside the if() end w/a semi-colon? The print statements added to process_bug.cgi seem more like debug than user explainitory, are the supposed to be removed before the final patch? I would think that GroupNameToBit() should be able to also tell if the group exists (return 0 if it doesn't). Then you wouldn't have to call both GroupExists() and GroupNameToBit() [which would result in two queries instead of one]. This patch doesn't seem to interact terribly well with with the patch from bug 39816 (a mass change clears the additional viewing options [although that's a bug in the other patch, not this one, as I think about it]). The interface on the buglist page seems a bit confusing. Perhaps it should all be done from the table. I'm not sure why we would allow a bug to be added to a product group for a product that it isn't in. But again, that's not this bug, that another one (already marked FIXED, I believe). I would also recommend that in subs such as GroupNameToBit() you do a PushGlobalSqlState() and PopGlobalSqlState() to avoid sometimes mysterious dataloss type bugs.
Assignee | ||
Comment 19•23 years ago
|
||
Assignee | ||
Comment 20•23 years ago
|
||
Assignee | ||
Comment 21•23 years ago
|
||
>Multiline if() statements complete with comments... I've never seen that >before. Is that why the comments inside the if() end w/a semi-colon? Nope. The semi-colons are strictly semantic. >The print statements added to process_bug.cgi seem more like debug than user >explainitory, are the supposed to be removed before the final patch? Yep. They are just debugging statements that I thought would make the patch's behavior easier to review. >I would think that GroupNameToBit() should be able to also tell if the group >exists (return 0 if it doesn't). Then you wouldn't have to call both >GroupExists() and GroupNameToBit() [which would result in two queries instead >of one]. Done. >This patch doesn't seem to interact terribly well with with the patch from bug >39816 (a mass change clears the additional viewing options [although that's a >bug in the other patch, not this one, as I think about it]). I'm looking into that next. >The interface on the buglist page seems a bit confusing. Perhaps it should all >be done from the table. I'm not sure why we would allow a bug to be added to a >product group for a product that it isn't in. But again, that's not this bug, >that another one (already marked FIXED, I believe). The latest version of the patch (and the one that is running on landfill) does not allow the user to keep the bug in the old product group. I moved the UI for this patch into the "verify" page that appears when you change products (currently with options for verifying the version, component, and target milestone). This way it appears for both single and multiple bug changes and is tied to the specific act of changing products. I thought this made more sense than putting it on one of the other pages, where it would take up space and attract attention even though it is irrelevant except during a product change. I cleaned up the appearance and code for the "verify" screen in the process. >I would also recommend that in subs such as GroupNameToBit() you do a >PushGlobalSqlState() and PopGlobalSqlState() to avoid sometimes mysterious >dataloss type bugs. I added this to the two functions in this patch. I can see a few other functions that could use it, but I'll file a separate bug on those since I don't want to change anything out of the scope of this patch and possibly introduce more issues.
Assignee | ||
Comment 22•23 years ago
|
||
Assignee | ||
Comment 23•23 years ago
|
||
The latest patch fixes the problem Jake discovered where you can add the bug to the group twice (which results in the bug being added to the group with the next higher groupset bit) by saying "add to group" on both the "change multiple bugs" and the "confirm product change" forms. The bug only gets added to the group once if you do this now.
Comment 24•23 years ago
|
||
Zach checked this in and forgot to mark the bug fixed. r=Jake in irc.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Comment 25•23 years ago
|
||
I didn't forget, just had to go out for a while :)
Comment 26•23 years ago
|
||
Moving to Bugzilla product
Component: Bugzilla → Bugzilla-General
Product: Webtools → Bugzilla
Version: other → unspecified
Updated•12 years ago
|
QA Contact: matty_is_a_geek → default-qa
You need to log in
before you can comment on or make changes to this bug.
Description
•