Closed Bug 471523 Opened 17 years ago Closed 17 years ago

cloning a bug copies the newest visible comment for Newest to Oldest comment order

Categories

(Bugzilla :: Creating/Changing Bugs, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 3.2

People

(Reporter: timeless, Assigned: LpSolit)

References

()

Details

Attachments

(1 file, 1 obsolete file)

1. load https://bugzilla.mozilla.org/userprefs.cgi 2. set: When viewing a bug, show comments in this order [Newest to Oldest] 3. load a bug, e.g. bug 468617 4. click "clone" 5. click "Bugzilla" 6. examine the comment that was copied expected results: (presumably) copy the initial comment (unless it's hidden!) actual results: it copied the newest comment.
In enter_bug.cgi, $vars->{'comment'} = $cloned_bug->longdescs->[0]->{'body'}; will return the first comment based on your preferences. We should probably call GetComments() directly so that we can pass the sort order, and eventually limit the search to the first comment. Else if you clone a bug with 200 comments, they are all returned, with 200 commenter objects, despite you absolutely don't care about the other 199 comments.
Flags: blocking3.2.1+
OS: Mac OS X → All
Hardware: PowerPC → All
Target Milestone: --- → Bugzilla 3.2
Attached patch patch for tip, v1 (obsolete) — Splinter Review
This patch is for tip only as it depends on bug 472556, which permits to call GetComments() with an end time only. The way I modified the code in enter_bug.cgi makes it only load the first comment instead of all comments of the original bug, which is a small perf win. To do this, I had to change the format of the creation_ts field to also return seconds, else GetComments() would see creation_ts (without seconds) as always being older than the real creation date of the bug (with seconds). For 3.2, I will attach a much less invasive patch.
Assignee: create-and-change → LpSolit
Status: NEW → ASSIGNED
Attachment #358718 - Flags: review?(mkanat)
This backport is safe as it doesn't alter Bug.pm at all.
Attachment #358718 - Attachment is obsolete: true
Attachment #358719 - Flags: review?(mkanat)
Attachment #358718 - Flags: review?(mkanat)
Comment on attachment 358718 [details] [diff] [review] patch for tip, v1 errr... this one is not obsolete.
Attachment #358718 - Attachment is obsolete: false
Attachment #358718 - Flags: review?(mkanat)
Attachment #358719 - Flags: review?(mkanat) → review+
Comment on attachment 358718 [details] [diff] [review] patch for tip, v1 >+ $dbh->sql_date_format('creation_ts', '%Y.%m.%d %H:%i:%s') . ' AS creation_ts', That puts seconds into the bugmail comment header. :-(
(In reply to comment #5) > That puts seconds into the bugmail comment header. :-( Seconds are already displayed in bugmail comment headers. That's unrelated to my patch.
OK, I'm going to land the "patch for 3.2" on both tip and the 3.2 branch, as mkanat seems to hesitate about the "patch for tip". But I still think it's the right way to go to avoid loading all comments when only the first one is in use.
Flags: approval3.2+
Flags: approval+
tip: Checking in enter_bug.cgi; /cvsroot/mozilla/webtools/bugzilla/enter_bug.cgi,v <-- enter_bug.cgi new revision: 1.168; previous revision: 1.167 done 3.2: Checking in enter_bug.cgi; /cvsroot/mozilla/webtools/bugzilla/enter_bug.cgi,v <-- enter_bug.cgi new revision: 1.160.2.5; previous revision: 1.160.2.4 done
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Attachment #358718 - Attachment is obsolete: true
Attachment #358718 - Flags: review?(mkanat)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: