summaryrefslogtreecommitdiffstats
path: root/attachment.cgi
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2008-01-20 22:03:53 +0100
committerlpsolit%gmail.com <>2008-01-20 22:03:53 +0100
commitba956f07b4f06f82ff679d8475bbde2dda288e6d (patch)
treef8caa6eafc3235e9109322aa4f51f86870437edc /attachment.cgi
parent2d59048f6fe2a4589b10f5e5f914e4b14204897e (diff)
downloadbugzilla-ba956f07b4f06f82ff679d8475bbde2dda288e6d.tar.gz
bugzilla-ba956f07b4f06f82ff679d8475bbde2dda288e6d.tar.xz
Bug 413222: Implement $attachment->remove_from_db - Patch by Frédéric Buclin <LpSolit@gmail.com> a=LpSolit
Diffstat (limited to 'attachment.cgi')
-rwxr-xr-xattachment.cgi10
1 files changed, 1 insertions, 9 deletions
diff --git a/attachment.cgi b/attachment.cgi
index 6fd238c2f..529e0aa0d 100755
--- a/attachment.cgi
+++ b/attachment.cgi
@@ -649,19 +649,11 @@ sub delete_attachment {
$template->process("attachment/delete_reason.txt.tmpl", $vars, \$msg)
|| ThrowTemplateError($template->error());
- $dbh->bz_start_transaction();
- $dbh->do('DELETE FROM attach_data WHERE id = ?', undef, $attachment->id);
- $dbh->do('UPDATE attachments SET mimetype = ?, ispatch = ?, isurl = ?,
- isobsolete = ?
- WHERE attach_id = ?', undef,
- ('text/plain', 0, 0, 1, $attachment->id));
- $dbh->do('DELETE FROM flags WHERE attach_id = ?', undef, $attachment->id);
- $dbh->bz_commit_transaction();
-
# If the attachment is stored locally, remove it.
if (-e $attachment->_get_local_filename) {
unlink $attachment->_get_local_filename;
}
+ $attachment->remove_from_db();
# Now delete the token.
delete_token($token);