From ce23102518ac23defee5bdd2927b0622afd9e32b Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" Date: Tue, 8 Sep 2009 16:12:31 +0000 Subject: [PATCH] =?UTF-8?q?Bug=20509035:=20An=20empty=20e-mail=20gets=20se?= =?UTF-8?q?nt=20to=20non-timetrackinggroup=20members=20if=20I=20change=20t?= =?UTF-8?q?ime=20tracking=20information=20-=20Patch=20by=20Fr=C3=83=C2=A9d?= =?UTF-8?q?=C3=83=C2=A9ric=20Buclin=20=20r=3Dmkanat=20a?= =?UTF-8?q?=3DLpSolit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn://10.0.0.236/trunk@258336 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/webtools/bugzilla/Bugzilla/BugMail.pm | 21 +++++++------------ 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/mozilla/webtools/bugzilla/Bugzilla/BugMail.pm b/mozilla/webtools/bugzilla/Bugzilla/BugMail.pm index bea36e8660f..5bbbe723a8e 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/BugMail.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/BugMail.pm @@ -576,22 +576,11 @@ sub sendMail { $difftext .= $diff->{'text'}; } } - - if ($difftext eq "" && $newcomments eq "" && !$isnew) { + + if ($difftext eq "" && !scalar(@$newcomments) && !$isnew) { # Whoops, no differences! return 0; } - - # If an attachment was created, then add an URL. (Note: the 'g'lobal - # replace should work with comments with multiple attachments.) - - if ( $newcomments =~ /Created an attachment \(/ ) { - - my $showattachurlbase = - Bugzilla->params->{'urlbase'} . "attachment.cgi?id="; - - $newcomments =~ s/(Created an attachment \(id=([0-9]+)\))/$1\n --> \(${showattachurlbase}$2\)/g; - } my $diffs = $difftext; # Remove extra newlines. @@ -686,9 +675,15 @@ sub get_comments_by_bug { my $raw = 1; # Do not format comments which are not of type CMT_NORMAL. my $comments = Bugzilla::Bug::GetComments($id, "oldest_to_newest", $start, $end, $raw); + my $attach_base = correct_urlbase() . 'attachment.cgi?id='; foreach my $comment (@$comments) { $comment->{count} = $count++; + # If an attachment was created, then add an URL. (Note: the 'g'lobal + # replace should work with comments with multiple attachments.) + if ($comment->{body} =~ /Created an attachment \(/) { + $comment->{body} =~ s/(Created an attachment \(id=([0-9]+)\))/$1\n --> \($attach_base$2\)/g; + } } if (Bugzilla->params->{'insidergroup'}) {