summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Bug.pm
diff options
context:
space:
mode:
authorByron Jones <bjones@mozilla.com>2013-06-19 16:59:28 +0200
committerByron Jones <bjones@mozilla.com>2013-06-19 16:59:28 +0200
commitfa1486fb4ecd71bdf45b21b74b67b3bf65e89450 (patch)
treee63a47c0c578ed9b1a5e64692167013d677ebd41 /Bugzilla/Bug.pm
parent67ff372dc122ba876192307b5a1ddf7b9d143773 (diff)
downloadbugzilla-fa1486fb4ecd71bdf45b21b74b67b3bf65e89450.tar.gz
bugzilla-fa1486fb4ecd71bdf45b21b74b67b3bf65e89450.tar.xz
Bug 884817: move loading of comments into Bugzilla::Bug::preload()
Diffstat (limited to 'Bugzilla/Bug.pm')
-rw-r--r--Bugzilla/Bug.pm9
1 files changed, 9 insertions, 0 deletions
diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm
index bae5971ba..3805a51c8 100644
--- a/Bugzilla/Bug.pm
+++ b/Bugzilla/Bug.pm
@@ -512,6 +512,13 @@ sub preload {
# If we don't do this, can_see_bug will do one call per bug in
# the dependency lists, during get_bug_link in Bugzilla::Template.
$user->visible_bugs(\@all_dep_ids);
+
+ # We preload comments here in order to allow us to compare the time it
+ # takes to load comments from the database with the template rendering
+ # time.
+ foreach my $bug (@$bugs) {
+ $bug->comments();
+ }
}
sub possible_duplicates {
@@ -3436,6 +3443,8 @@ sub comments {
}
Bugzilla::Comment->preload($self->{'comments'});
}
+ return unless defined wantarray;
+
my @comments = @{ $self->{'comments'} };
my $order = $params->{order}