From 59fc67aa8f4a4a00037d01107da07da5e82c8127 Mon Sep 17 00:00:00 2001 From: Dave Lawrence Date: Thu, 23 Aug 2012 12:51:43 -0400 Subject: Bug 785063 - content of x-bugzilla-changed-fields in bugmail has changed from field descriptions to field names r=glob --- Bugzilla/BugMail.pm | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'Bugzilla/BugMail.pm') diff --git a/Bugzilla/BugMail.pm b/Bugzilla/BugMail.pm index 31a0a1af2..069ebbe60 100644 --- a/Bugzilla/BugMail.pm +++ b/Bugzilla/BugMail.pm @@ -401,12 +401,15 @@ sub sendMail { push(@watchingrel, 'None') unless @watchingrel; push @watchingrel, map { user_id_to_login($_) } @$watchingRef; - my @changedfields = uniq map { $_->{field_name} } @display_diffs; + # BMO: Use field descriptions instead of field names in header + my @changedfields = uniq map { $_->{field_desc} } @display_diffs; + my @changedfieldnames = uniq map { $_->{field_name} } @display_diffs; # Add attachments.created to changedfields if one or more # comments contain information about a new attachment if (grep($_->type == CMT_ATTACHMENT_CREATED, @send_comments)) { - push(@changedfields, 'attachments.created'); + push(@changedfields, 'Attachment Created'); + push(@changedfieldnames, 'attachment.created'); } my $vars = { @@ -419,7 +422,8 @@ sub sendMail { reasonswatchheader => join(" ", @watchingrel), changer => $changer, diffs => \@display_diffs, - changedfields => \@changedfields, + changedfields => \@changedfields, + changedfieldnames => \@changedfieldnames, new_comments => \@send_comments, threadingmarker => build_thread_marker($bug->id, $user->id, !$bug->lastdiffed), referenced_bugs => $referenced_bugs, @@ -484,6 +488,7 @@ sub _get_diffs { my $diffs = $dbh->selectall_arrayref( "SELECT fielddefs.name AS field_name, + fielddefs.description AS field_desc, bugs_activity.bug_when, bugs_activity.removed AS old, bugs_activity.added AS new, bugs_activity.attach_id, bugs_activity.comment_id, bugs_activity.who -- cgit v1.2.3-24-g4f1b