diff options
author | mkanat%bugzilla.org <> | 2009-12-04 15:28:47 +0100 |
---|---|---|
committer | mkanat%bugzilla.org <> | 2009-12-04 15:28:47 +0100 |
commit | bc19204d3dffa448b364bfa4b5691a24f39f6765 (patch) | |
tree | 1fa13715dc812d8e36240a85374a34b29248973a /post_bug.cgi | |
parent | 9c623cb93101c9bb8bf8c0428ca66dd5f7fdc63d (diff) | |
download | bugzilla-bc19204d3dffa448b364bfa4b5691a24f39f6765.tar.gz bugzilla-bc19204d3dffa448b364bfa4b5691a24f39f6765.tar.xz |
Bug 452919: Allow the "created an attachment" message in comments to be localized
Patch by Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=LpSolit
Diffstat (limited to 'post_bug.cgi')
-rwxr-xr-x | post_bug.cgi | 16 |
1 files changed, 3 insertions, 13 deletions
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'; |