Closed Bug 71790 Opened 24 years ago Closed 22 years ago

Duplicate resolution field should include bug number of original

Categories

(Bugzilla :: Creating/Changing Bugs, enhancement, P1)

enhancement

Tracking

()

RESOLVED FIXED
Bugzilla 2.18

People

(Reporter: justdave, Assigned: burnus)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 6 obsolete files)

I'm thinking something like this in bug_form.pl: Status: RESOLVED Resolution: DUPLICATE (53623) Where the number in parens is the number of the original bug, clickable, of course. I thought of this trying to come up with some way to display the duplicate data from the database in the bug. That data is now saved in the database, but is not displayed anywhere. We currently have to trust that the comments are correct to find the original of a duplicate.
I'm thinking for BZ3 we might want to associate a field with each status. For example, INVALID might have an invalidation reason, or some such. This would work the same.
Apparently we already have this data, so 2.16.
Target Milestone: --- → Bugzilla 2.16
Priority: -- → P2
->New (old by now?) product Bugzilla
Assignee: tara → endico
Component: Bugzilla → Query/Bug List
Product: Webtools → Bugzilla
Version: other → unspecified
correcting component
Assignee: endico → myk
Component: Query/Bug List → Creating/Changing Bugs
We are currently trying to wrap up Bugzilla 2.16. We are now close enough to release time that anything that wasn't already ranked at P1 isn't going to make the cut. Thus this is being retargetted at 2.18. If you strongly disagree with this retargetting, please comment, however, be aware that we only have about 2 weeks left to review and test anything at this point, and we intend to devote this time to the remaining bugs that were designated as release blockers.
Target Milestone: Bugzilla 2.16 → Bugzilla 2.18
*** Bug 114318 has been marked as a duplicate of this bug. ***
*** Bug 120513 has been marked as a duplicate of this bug. ***
*** Bug 123737 has been marked as a duplicate of this bug. ***
bumping priority based on the number of dupes.
Priority: P2 → P1
Attached patch First round (obsolete) — Splinter Review
Take bug (note: I'm away the next two weeks).
Assignee: myk → burnus
Attachment #116645 - Flags: review?(bbaetz)
Attached patch v1.2 - a "==" is not a "eq" (obsolete) — Splinter Review
Attachment #116645 - Attachment is obsolete: true
Attachment #116646 - Flags: review?(bbaetz)
Attachment #116645 - Flags: review?(bbaetz)
Comment on attachment 116646 [details] [diff] [review] v1.2 - a "==" is not a "eq" I'd much rather you did this (on demand) in Bug.pm. Also, don't use SendSQL - use the DBI methods instead.
Attachment #116646 - Flags: review?(bbaetz) → review-
Attached patch v2: Now uses $dbh in Bug.pm (obsolete) — Splinter Review
Attachment #116646 - Attachment is obsolete: true
Attachment #119131 - Flags: review?(bbaetz)
Blocks: 200202
Attachment #119131 - Attachment is obsolete: true
Attachment #119286 - Flags: review?(bbaetz)
Attachment #116646 - Flags: review-
Comment on attachment 119286 [details] [diff] [review] v2.0.1 Uses $dbh with placeholder (cf. suggestions at developer@) >Index: Bug.pm >=================================================================== >RCS file: /cvsroot/mozilla/webtools/bugzilla/Bug.pm,v >retrieving revision 1.30 >diff -u -r1.30 Bug.pm >--- Bug.pm 23 Feb 2003 07:31:07 -0000 1.30 >+++ Bug.pm 3 Apr 2003 12:22:34 -0000 >@@ -262,6 +262,22 @@ > return $self; > } > >+sub duplicate_bug_id { >+ my ($self) = @_; >+ >+ return $self->{'duplicate_bug_id'} if exists $self->{'duplicate_bug_id'}; >+ >+ if ($self->{'resolution'} eq 'DUPLICATE') { >+ my $dbh = Bugzilla->dbh; >+ return $self->{'duplicate_bug_id'} = >+ $dbh->selectrow_array(q{SELECT dupe_of >+ FROM duplicates >+ WHERE dupe = ?}, >+ undef, >+ $self->{'bug_id'}); >+ } >+} If it isn't a duplicate, what should you return? (And should you cache that result?) Or should you just die? What happen when process_bug reopens a bug, and then the next bug shows is the same bug, and the result ends up cached? (I don't know if this matters in our current process_bug handling, mind you) >Index: show_bug.cgi > $vars->{'displayfields'} = \%displayfields; >+$vars->{'GetBugLink'} = \&GetBugLink; You don't need this.... >Index: template/en/default/bug/edit.html.tmpl >+ <td> >+ [% bug.resolution FILTER html %] >+ [% IF bug.resolution == "DUPLICATE" %] >+ [% bug_id = bug.duplicate_bug_id %] >+ of [% GetBugLink(bug_id,"Bug $bug_id") %] ... because this becomes [% "Bug $bug_id" FILTER bug_link($bug_id) %] bug_link is a dynamic filter - it will filter the input text with a link to the argument bug id. I suppose it should take a bug object one day, not just the id, and when it does, duplicate_bug_id can reutrn a bug object. Doesn't matter for now, though.
Attachment #119286 - Flags: review?(bbaetz) → review-
> What happen when process_bug reopens a bug, and then the next bug shows is the > same bug, and the result ends up cached? (I don't know if this matters in our > current process_bug handling, mind you) I haven't check this, but I copied the code from the other items (groups, actual_time, longdescs, user, choices). I also return now a undef.
Attachment #119286 - Attachment is obsolete: true
Attachment #119289 - Flags: review?(bbaetz)
Comment on attachment 119289 [details] [diff] [review] v2.0.2 Use FILTER bug_link("Bug $bug_id") instead >+sub duplicate_bug_id { >+ my ($self) = @_; >+ >+ return $self->{'duplicate_bug_id'} if exists $self->{'duplicate_bug_id'}; >+ >+ if ($self->{'resolution'} eq 'DUPLICATE') { >+ my $dbh = Bugzilla->dbh; >+ return $self->{'duplicate_bug_id'} = >+ $dbh->selectrow_array(q{SELECT dupe_of >+ FROM duplicates >+ WHERE dupe = ?}, >+ undef, >+ $self->{'bug_id'}); >+ } >+ return undef; >+} That embedded return() is really obscure; it looks like this function just returns undef. Consider using a local variable, initialised to undef anf set inside the if test, for clarity. You can also probably call it dup_id instead of duplicate_bug_id :-) >- <td>[% bug.resolution FILTER html %]</td> >+ <td> >+ [% bug.resolution FILTER html %] >+ [% IF bug.resolution == "DUPLICATE" %] >+ [% bug_id = bug.duplicate_bug_id %] >+ of [% bug_id FILTER bug_link("Bug $bug_id") %] This is a bit confusing; better to just use bug.dup_id in both places, rather than have a local. Or, rename the local to something like dup_id. >+ [% END %] >+ </td> Nit: no capital b on Bug, as it's not the beginning of a sentence. (We may get this wrong elsewhere; that's no excuse. :-) Gerv
bug.dup id won't work inside the string - you'd hve to concatenate, or use ${bug.dup_id} (I _think_ that that works) which isn't as nice.
Attachment #119131 - Flags: review?(bbaetz)
Attachment #119289 - Attachment is obsolete: true
Attachment #119726 - Flags: review?(bbaetz)
Attachment #119289 - Flags: review?(bbaetz)
Comment on attachment 119726 [details] [diff] [review] v2.0.3: Review nits fixed. r=bbaetz. Looks nice, works, etc. However, that FILTER should be the other way arround - we filter the _text_ by applying a link to the particular bug. I stuffed up the code in Bugzilla/Template.pm - GetBugLink takes the bug# as the first item, not the text. The only other user of this happens to just linkify the number, so I never noticed. Oops. Eitehr fix that too, or don't, and I'll file a bug when this gets checked in.
Attachment #119726 - Flags: review?(bbaetz) → review+
> I stuffed up the code in Bugzilla/Template.pm - GetBugLink takes the bug# as > the first item, not the text. > Eitehr fix that too, or don't, and I'll file a bug when this gets checked in. I will fix this; the check-in will contain these extra changes (compared to attachment 119726 [details] [diff] [review]): ++++ Bugzilla/Template.pm 8 Apr 2003 11:15:18 -0000 +- return &::GetBugLink($text, $bug); ++ return &::GetBugLink($bug, $text); ++++ template/en/default/bug/edit.html.tmpl 8 Apr 2003 11:15:18 -0000 -+ of [% bug.dup_id FILTER bug_link("bug ${bug.dup_id}") %] ++ of [% "bug ${bug.dup_id}" FILTER bug_link(bug.dup_id) %]
Status: NEW → ASSIGNED
Flags: approval?
Flags: approval? → approval+
FIXED. I could swear that I'd clicked on Commit yesterday... Checked in: mozilla/webtools/bugzilla/template/en/default/bug/edit.html.tmpl 1.32 mozilla/webtools/bugzilla/Bugzilla/Template.pm 1.4 mozilla/webtools/bugzilla/Bug.pm 1.31
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Comment on attachment 214029 [details] [diff] [review] docs patch about 'Bugzilla Database Tables' section, for 2.18 which bugs are duplicates of which other bugs.
Attachment #214029 - Flags: review?(documentation) → review-
Attachment #214029 - Attachment is obsolete: true
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

Creator:
Created:
Updated:
Size: