diff options
author | Dave Lawrence <dlawrence@mozilla.com> | 2014-01-07 06:13:41 +0100 |
---|---|---|
committer | Dave Lawrence <dlawrence@mozilla.com> | 2014-01-07 06:13:41 +0100 |
commit | 14ece482a9028897f3877e157fdad172f9eeb6eb (patch) | |
tree | c0bd56d68740d6c16929bb9f65cd43e49a6e0d0d | |
parent | 678ad6b0f33fbd05da033ce04f14e14951aa7a9e (diff) | |
download | bugzilla-14ece482a9028897f3877e157fdad172f9eeb6eb.tar.gz bugzilla-14ece482a9028897f3877e157fdad172f9eeb6eb.tar.xz |
Bug 956052 - backport upstream bug 945535 to bmo/4.2 for performance improvement in bugs with large number of attachments
-rw-r--r-- | Bugzilla/Attachment/PatchReader.pm | 2 | ||||
-rw-r--r-- | Bugzilla/Bug.pm | 2 | ||||
-rwxr-xr-x | attachment.cgi | 5 |
3 files changed, 4 insertions, 5 deletions
diff --git a/Bugzilla/Attachment/PatchReader.pm b/Bugzilla/Attachment/PatchReader.pm index 7c5dfc470..1ab14f386 100644 --- a/Bugzilla/Attachment/PatchReader.pm +++ b/Bugzilla/Attachment/PatchReader.pm @@ -49,7 +49,7 @@ sub process_diff { if ($lc->{interdiffbin} && $lc->{diffpath}) { # Get the list of attachments that the user can view in this bug. my @attachments = - @{Bugzilla::Attachment->get_attachments_by_bug($attachment->bug_id)}; + @{Bugzilla::Attachment->get_attachments_by_bug($attachment->bug)}; # Extract patches only. @attachments = grep {$_->ispatch == 1} @attachments; # We want them sorted from newer to older. diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index 272526f12..e0b1b603f 100644 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -3254,7 +3254,7 @@ sub attachments { return [] if $self->{'error'}; $self->{'attachments'} = - Bugzilla::Attachment->get_attachments_by_bug($self->bug_id, {preload => 1}); + Bugzilla::Attachment->get_attachments_by_bug($self, {preload => 1}); return $self->{'attachments'}; } diff --git a/attachment.cgi b/attachment.cgi index 57706d5e0..18ac6f57a 100755 --- a/attachment.cgi +++ b/attachment.cgi @@ -459,9 +459,8 @@ sub diff { sub viewall { # Retrieve and validate parameters my $bug = Bugzilla::Bug->check({ id => scalar $cgi->param('bugid'), cache => 1 }); - my $bugid = $bug->id; - my $attachments = Bugzilla::Attachment->get_attachments_by_bug($bugid); + my $attachments = Bugzilla::Attachment->get_attachments_by_bug($bug); # Ignore deleted attachments. @$attachments = grep { $_->datasize } @$attachments; @@ -637,7 +636,7 @@ sub edit { my $attachment = validateID(); my $bugattachments = - Bugzilla::Attachment->get_attachments_by_bug($attachment->bug_id); + Bugzilla::Attachment->get_attachments_by_bug($attachment->bug); my $any_flags_requesteeble = grep { $_->is_requestable && $_->is_requesteeble } @{$attachment->flag_types}; |