diff options
author | Byron Jones <bjones@mozilla.com> | 2013-06-19 16:59:28 +0200 |
---|---|---|
committer | Byron Jones <bjones@mozilla.com> | 2013-06-19 16:59:28 +0200 |
commit | fa1486fb4ecd71bdf45b21b74b67b3bf65e89450 (patch) | |
tree | e63a47c0c578ed9b1a5e64692167013d677ebd41 /Bugzilla | |
parent | 67ff372dc122ba876192307b5a1ddf7b9d143773 (diff) | |
download | bugzilla-fa1486fb4ecd71bdf45b21b74b67b3bf65e89450.tar.gz bugzilla-fa1486fb4ecd71bdf45b21b74b67b3bf65e89450.tar.xz |
Bug 884817: move loading of comments into Bugzilla::Bug::preload()
Diffstat (limited to 'Bugzilla')
-rw-r--r-- | Bugzilla/Bug.pm | 9 |
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} |