diff options
author | 2009-12-04 14:28:47 +0000 | |
---|---|---|
committer | 2009-12-04 14:28:47 +0000 | |
commit | bc19204d3dffa448b364bfa4b5691a24f39f6765 (patch) | |
tree | 1fa13715dc812d8e36240a85374a34b29248973a /post_bug.cgi | |
parent | Bug 204106: Make enter_bug indicate which fields are mandatory (diff) | |
download | bugzilla-bc19204d3dffa448b364bfa4b5691a24f39f6765.tar.gz bugzilla-bc19204d3dffa448b364bfa4b5691a24f39f6765.tar.bz2 bugzilla-bc19204d3dffa448b364bfa4b5691a24f39f6765.zip |
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'; |