summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authorDavid Lawrence <dlawrence@mozilla.com>2011-10-17 06:06:44 +0200
committerDavid Lawrence <dlawrence@mozilla.com>2011-10-17 06:06:44 +0200
commit1603951776f59a25f51dc6bfe767ee2cb032ba19 (patch)
tree76a59debec8c5cbfe9cc33764ce73034f2a8b369 /extensions
parentb6b00b8804b1e0a0defb5b687013190dfda42b57 (diff)
downloadbugzilla-1603951776f59a25f51dc6bfe767ee2cb032ba19.tar.gz
bugzilla-1603951776f59a25f51dc6bfe767ee2cb032ba19.tar.xz
Bug 694439: The Inline History extension should cache user objects when parsing
bug history r=glob
Diffstat (limited to 'extensions')
-rw-r--r--extensions/InlineHistory/Extension.pm10
1 files changed, 9 insertions, 1 deletions
diff --git a/extensions/InlineHistory/Extension.pm b/extensions/InlineHistory/Extension.pm
index 61bc232da..da1e3f274 100644
--- a/extensions/InlineHistory/Extension.pm
+++ b/extensions/InlineHistory/Extension.pm
@@ -71,10 +71,18 @@ sub template_before_process {
return;
}
+ Bugzilla->request_cache->{ih_user_cache} ||= {};
+ my $user_cache = Bugzilla->request_cache->{ih_user_cache};
+
# augment and tweak
foreach my $operation (@$activity) {
# make operation.who an object
- $operation->{who} = Bugzilla::User->new({ name => $operation->{who} });
+ if (!$user_cache->{$operation->{who}}) {
+ $user_cache->{$operation->{who}}
+ = Bugzilla::User->new({ name => $operation->{who} });
+ }
+ $operation->{who} = $user_cache->{$operation->{who}};
+
for (my $i = 0; $i < scalar(@{$operation->{changes}}); $i++) {
my $change = $operation->{changes}->[$i];