Commit 4f023328 authored by Edmund Yan's avatar Edmund Yan Committed by Frédéric Buclin

Bug 679516: Call Bugzilla::Object->remove_from_db when deleting an object

r/a=LpSolit
parent e7d28afb
......@@ -948,7 +948,7 @@ sub remove_from_db {
}
# Once we reach here, we should be OK to delete.
$dbh->do('DELETE FROM fielddefs WHERE id = ?', undef, $self->id);
$self->SUPER::remove_from_db();
my $type = $self->type;
......
......@@ -158,7 +158,7 @@ sub remove_from_db {
}
}
$dbh->do('DELETE FROM milestones WHERE id = ?', undef, $self->id);
$self->SUPER::remove_from_db();
}
################################
......
......@@ -317,7 +317,7 @@ sub remove_from_db {
}
}
$dbh->do("DELETE FROM products WHERE id = ?", undef, $self->id);
$self->SUPER::remove_from_db();
$dbh->bz_commit_transaction();
......
......@@ -76,14 +76,7 @@ sub create {
sub remove_from_db {
my $self = shift;
my $dbh = Bugzilla->dbh;
my $id = $self->id;
$dbh->bz_start_transaction();
$self->SUPER::remove_from_db();
$dbh->do('DELETE FROM status_workflow
WHERE old_status = ? OR new_status = ?',
undef, $id, $id);
$dbh->bz_commit_transaction();
delete Bugzilla->request_cache->{status_bug_state_open};
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment