From bc19204d3dffa448b364bfa4b5691a24f39f6765 Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Fri, 4 Dec 2009 14:28:47 +0000 Subject: Bug 452919: Allow the "created an attachment" message in comments to be localized Patch by Max Kanat-Alexander r=LpSolit, a=LpSolit --- post_bug.cgi | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'post_bug.cgi') diff --git a/post_bug.cgi b/post_bug.cgi index c9de83bb7..ef0f40d4d 100755 --- a/post_bug.cgi +++ b/post_bug.cgi @@ -223,19 +223,9 @@ if (defined($cgi->upload('data')) || $cgi->param('attachurl')) { $bug, $attachment, $vars, SKIP_REQUESTEE_ON_ERROR); $attachment->set_flags($flags, $new_flags); $attachment->update($timestamp); - - # Update the comment to include the new attachment ID. - # This string is hardcoded here because Template::quoteUrls() - # expects to find this exact string. - my $new_comment = "Created an attachment (id=" . $attachment->id . ")\n" . - $attachment->description . "\n"; - # We can use $bug->comments here because we are sure that the bug - # description is of type CMT_NORMAL. No need to include it if it's - # empty, though. - if ($bug->comments->[0]->body !~ /^\s+$/) { - $new_comment .= "\n" . $bug->comments->[0]->body; - } - $bug->update_comment($bug->comments->[0]->id, $new_comment); + my $comment = $bug->comments->[0]; + $comment->set_type(CMT_ATTACHMENT_CREATED, $attachment->id); + $comment->update(); } else { $vars->{'message'} = 'attachment_creation_failed'; -- cgit v1.2.3-24-g4f1b