summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdmund Yan <edmundhyan@gmail.com>2011-08-21 02:11:29 +0200
committerFrédéric Buclin <LpSolit@gmail.com>2011-08-21 02:11:29 +0200
commit4f023328eeab5dd137263a2488fb8ef307170f07 (patch)
tree7ba9bd964623b0079801887fb1fbd980a17014dd
parente7d28afbc4990c564be08f77cc472f92962f8f45 (diff)
downloadbugzilla-4f023328eeab5dd137263a2488fb8ef307170f07.tar.gz
bugzilla-4f023328eeab5dd137263a2488fb8ef307170f07.tar.xz
Bug 679516: Call Bugzilla::Object->remove_from_db when deleting an object
r/a=LpSolit
-rw-r--r--Bugzilla/Field.pm2
-rw-r--r--Bugzilla/Milestone.pm2
-rw-r--r--Bugzilla/Product.pm2
-rw-r--r--Bugzilla/Status.pm7
4 files changed, 3 insertions, 10 deletions
diff --git a/Bugzilla/Field.pm b/Bugzilla/Field.pm
index aa3551182..6b42cc4af 100644
--- a/Bugzilla/Field.pm
+++ b/Bugzilla/Field.pm
@@ -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;
diff --git a/Bugzilla/Milestone.pm b/Bugzilla/Milestone.pm
index 92bc2192a..61e2a12bb 100644
--- a/Bugzilla/Milestone.pm
+++ b/Bugzilla/Milestone.pm
@@ -158,7 +158,7 @@ sub remove_from_db {
}
}
- $dbh->do('DELETE FROM milestones WHERE id = ?', undef, $self->id);
+ $self->SUPER::remove_from_db();
}
################################
diff --git a/Bugzilla/Product.pm b/Bugzilla/Product.pm
index 85524ac47..64a146be9 100644
--- a/Bugzilla/Product.pm
+++ b/Bugzilla/Product.pm
@@ -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();
diff --git a/Bugzilla/Status.pm b/Bugzilla/Status.pm
index ffef600de..f3d6d808c 100644
--- a/Bugzilla/Status.pm
+++ b/Bugzilla/Status.pm
@@ -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};
}