summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Object.pm
diff options
context:
space:
mode:
authorByron Jones <bjones@mozilla.com>2014-03-04 08:50:54 +0100
committerByron Jones <bjones@mozilla.com>2014-03-04 08:50:54 +0100
commit9193214274889f2b7636146e72d8200e9bfaeb7b (patch)
treee570cc86aa8df53dd0e7e9d902d88450c5dc25c7 /Bugzilla/Object.pm
parent75eaf0d6c8ecf764d73cb870e504e84826d44751 (diff)
downloadbugzilla-9193214274889f2b7636146e72d8200e9bfaeb7b.tar.gz
bugzilla-9193214274889f2b7636146e72d8200e9bfaeb7b.tar.xz
Bug 966180: backport bug 956233 to bmo (enable USE_MEMCACHE on most objects)
Diffstat (limited to 'Bugzilla/Object.pm')
-rw-r--r--Bugzilla/Object.pm20
1 files changed, 16 insertions, 4 deletions
diff --git a/Bugzilla/Object.pm b/Bugzilla/Object.pm
index 43d2c07ac..936465b3f 100644
--- a/Bugzilla/Object.pm
+++ b/Bugzilla/Object.pm
@@ -48,9 +48,8 @@ use constant AUDIT_UPDATES => 1;
use constant AUDIT_REMOVES => 1;
# When USE_MEMCACHED is true, the class is suitable for serialisation to
-# Memcached. This will be flipped to true by default once the majority of
-# Bugzilla Object have been tested with Memcached.
-use constant USE_MEMCACHED => 0;
+# Memcached. See documentation in Bugzilla::Memcached for more information.
+use constant USE_MEMCACHED => 1;
# This allows the JSON-RPC interface to return Bugzilla::Object instances
# as though they were hashes. In the future, this may be modified to return
@@ -188,7 +187,20 @@ sub new_from_list {
# their own implementation of match which is not compatible
# with this one. However, match() still needs to have the right $invocant
# in order to do $class->DB_TABLE and so on.
- return match($invocant, { $id_field => \@detainted_ids });
+ my $list = match($invocant, { $id_field => \@detainted_ids });
+
+ # BMO: Populate the object cache with bug objects, which helps
+ # inline-history when viewing bugs with dependencies.
+ if ($class eq 'Bugzilla::Bug') {
+ foreach my $object (@$list) {
+ $class->_object_cache_set(
+ { id => $object->id, cache => 1 },
+ $object
+ );
+ }
+ }
+
+ return $list;
}
sub new_from_hash {