From 43572dfe14612f989a7722f2c64610b6f1e6dc56 Mon Sep 17 00:00:00 2001 From: Dylan Hardison Date: Mon, 14 Apr 2014 15:19:40 -0400 Subject: Bug 993913 - remove the %user_cache from inline history, and ensure the object cache is always used r=dkl --- extensions/InlineHistory/Extension.pm | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'extensions/InlineHistory') diff --git a/extensions/InlineHistory/Extension.pm b/extensions/InlineHistory/Extension.pm index 6c86fcfa8..803262517 100644 --- a/extensions/InlineHistory/Extension.pm +++ b/extensions/InlineHistory/Extension.pm @@ -62,12 +62,6 @@ sub template_before_process { # allow other extensions to alter history Bugzilla::Hook::process('inline_history_activtiy', { activity => $activity }); - # prime caches with objects already loaded - my %user_cache; - foreach my $comment (@{$bug->comments}) { - $user_cache{$comment->{author}->login} = $comment->{author}; - } - my %attachment_cache; foreach my $attachment (@{$bug->attachments}) { $attachment_cache{$attachment->id} = $attachment; @@ -79,8 +73,8 @@ sub template_before_process { # augment and tweak foreach my $operation (@$activity) { # make operation.who an object - $user_cache{$operation->{who}} ||= Bugzilla::User->new({ name => $operation->{who} }); - $operation->{who} = $user_cache{$operation->{who}}; + $operation->{who} = + Bugzilla::User->new({ name => $operation->{who}, cache => 1 }); for (my $i = 0; $i < scalar(@{$operation->{changes}}); $i++) { my $change = $operation->{changes}->[$i]; -- cgit v1.2.3-24-g4f1b