summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Object.pm
diff options
context:
space:
mode:
authorByron Jones <bjones@mozilla.com>2013-12-17 06:47:30 +0100
committerByron Jones <bjones@mozilla.com>2013-12-17 06:47:30 +0100
commitc469b433d581bf80fe2272dfd380cd12043aafd0 (patch)
tree4f86a06fdbbaf44e96e5bc4ec1ed76568558f522 /Bugzilla/Object.pm
parent210e17650e672e6023f1cafaf5536cd75e2254d4 (diff)
downloadbugzilla-c469b433d581bf80fe2272dfd380cd12043aafd0.tar.gz
bugzilla-c469b433d581bf80fe2272dfd380cd12043aafd0.tar.xz
Bug 815026: Bugzilla::Object cache should be cleared when an object is updated or removed from the database
Diffstat (limited to 'Bugzilla/Object.pm')
-rw-r--r--Bugzilla/Object.pm2
1 files changed, 2 insertions, 0 deletions
diff --git a/Bugzilla/Object.pm b/Bugzilla/Object.pm
index b1bc229bf..4525fa78a 100644
--- a/Bugzilla/Object.pm
+++ b/Bugzilla/Object.pm
@@ -477,6 +477,7 @@ sub update {
$dbh->bz_commit_transaction();
$self->_cache_remove({ id => $self->id });
+ $self->_cache_remove({ name => $self->name }) if $self->name;
if (wantarray) {
return (\%changes, $old_self);
@@ -496,6 +497,7 @@ sub remove_from_db {
$dbh->do("DELETE FROM $table WHERE $id_field = ?", undef, $self->id);
$dbh->bz_commit_transaction();
$self->_cache_remove({ id => $self->id });
+ $self->_cache_remove({ name => $self->name }) if $self->name;
undef $self;
}