From: Kohei Yoshino Date: Thu, 6 Jun 2019 16:38:14 +0000 (-0400) Subject: Bug 1556178 - Extraneous comma in history due to wrong joins, e.g. depends_on field... X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7fee3291713b04e5bb2574b454d14dfa78beba67;p=thirdparty%2Fbugzilla.git Bug 1556178 - Extraneous comma in history due to wrong joins, e.g. depends_on field in bug 1369194 --- diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index 7c486fe1d..6d529def6 100644 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -4524,7 +4524,9 @@ sub GetBugActivity { # Use DISTINCT and value comparison to suppress duplicated changes weirdly # made at the same time by the same user my $query - = "SELECT DISTINCT fielddefs.name, bugs_activity.attach_id, " + = "SELECT DISTINCT fielddefs.name, + bugs_activity.id AS activity_id, + bugs_activity.attach_id, " . $dbh->sql_date_format('bugs_activity.bug_when', '%Y.%m.%d %H:%i:%s') . " AS bug_when, bugs_activity.removed, bugs_activity.added, profiles.login_name, bugs_activity.comment_id @@ -4555,6 +4557,7 @@ sub GetBugActivity { $query .= " UNION ALL SELECT 'comment_tag' AS name, + NULL AS activity_id, NULL AS attach_id," . $dbh->sql_date_format('longdescs_tags_activity.bug_when', '%Y.%m.%d %H:%i:%s') @@ -4574,7 +4577,7 @@ sub GetBugActivity { push @args, $starttime if defined $starttime; } - $query .= "ORDER BY bug_when, comment_id"; + $query .= "ORDER BY bug_when, comment_id, activity_id"; my $list = $dbh->selectall_arrayref($query, undef, @args); @@ -4584,7 +4587,7 @@ sub GetBugActivity { my $incomplete_data = 0; foreach my $entry (@$list) { - my ($fieldname, $attachid, $when, $removed, $added, $who, $comment_id) + my ($fieldname, $activity_id, $attachid, $when, $removed, $added, $who, $comment_id) = @$entry; my %change; my $activity_visible = 1;