summaryrefslogtreecommitdiffstats
path: root/Bugzilla/BugMail.pm
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2006-11-21 03:24:55 +0100
committerlpsolit%gmail.com <>2006-11-21 03:24:55 +0100
commitd4bcf5272dffa704cfe97774088e9ecbafa03b47 (patch)
tree9179e3e04ab029f73011114f3934c18926684a0e /Bugzilla/BugMail.pm
parentb692a5a6388d604b1b698b6832c54308b0ff6f66 (diff)
downloadbugzilla-d4bcf5272dffa704cfe97774088e9ecbafa03b47.tar.gz
bugzilla-d4bcf5272dffa704cfe97774088e9ecbafa03b47.tar.xz
Bug 353656: User Interface gets corrupted by multiple localized users resolving bugs as duplicates - Patch by Frédéric Buclin <LpSolit@gmail.com> r=bkor a=justdave
Diffstat (limited to 'Bugzilla/BugMail.pm')
-rw-r--r--Bugzilla/BugMail.pm32
1 files changed, 8 insertions, 24 deletions
diff --git a/Bugzilla/BugMail.pm b/Bugzilla/BugMail.pm
index 9a83b1cd3..6ba6b3c77 100644
--- a/Bugzilla/BugMail.pm
+++ b/Bugzilla/BugMail.pm
@@ -652,17 +652,6 @@ sub get_comments_by_bug {
my $count = 0;
my $anyprivate = 0;
- my $query = 'SELECT profiles.login_name, profiles.realname, ' .
- $dbh->sql_date_format('longdescs.bug_when', '%Y.%m.%d %H:%i') . ',
- longdescs.thetext, longdescs.isprivate,
- longdescs.already_wrapped
- FROM longdescs
- INNER JOIN profiles
- ON profiles.userid = longdescs.who
- WHERE longdescs.bug_id = ? ';
-
- my @args = ($id);
-
# $start will be undef for new bugs, and defined for pre-existing bugs.
if ($start) {
# If $start is not NULL, obtain the count-index
@@ -670,26 +659,21 @@ sub get_comments_by_bug {
$count = $dbh->selectrow_array('SELECT COUNT(*) FROM longdescs
WHERE bug_id = ? AND bug_when <= ?',
undef, ($id, $start));
-
- $query .= ' AND longdescs.bug_when > ?
- AND longdescs.bug_when <= ? ';
- push @args, ($start, $end);
}
- $query .= ' ORDER BY longdescs.bug_when';
- my $comments = $dbh->selectall_arrayref($query, undef, @args);
+ my $comments = Bugzilla::Bug::GetComments($id, "oldest_to_newest", $start, $end);
- foreach (@$comments) {
- my ($who, $whoname, $when, $text, $isprivate, $already_wrapped) = @$_;
+ foreach my $comment (@$comments) {
if ($count) {
- $result .= "\n\n--- Comment #$count from $whoname <$who" .
- Bugzilla->params->{'emailsuffix'}. "> "
- . format_time($when) . " ---\n";
+ $result .= "\n\n--- Comment #$count from " . $comment->{'name'} . " <" .
+ $comment->{'email'} . Bugzilla->params->{'emailsuffix'} . "> " .
+ format_time($comment->{'time'}) . " ---\n";
}
- if ($isprivate > 0 && Bugzilla->params->{'insidergroup'}) {
+ if ($comment->{'isprivate'} > 0 && Bugzilla->params->{'insidergroup'}) {
$anyprivate = 1;
}
- $result .= ($already_wrapped ? $text : wrap_comment($text));
+ $result .= ($comment->{'already_wrapped'} ? $comment->{'body'}
+ : wrap_comment($comment->{'body'}));
$count++;
}
return ($result, $anyprivate);