From cc06a324051bc4ac2b60f7a7e38a1ab66a9e45b3 Mon Sep 17 00:00:00 2001 From: Frédéric Buclin Date: Tue, 6 Mar 2012 21:55:23 +0100 Subject: 2nd part of bug 731559: fix get_attachments_by_bug() everywhere a=LpSolit --- Bugzilla/Attachment/PatchReader.pm | 2 +- attachment.cgi | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Bugzilla/Attachment/PatchReader.pm b/Bugzilla/Attachment/PatchReader.pm index 9b2d9f15c..3be0555c1 100644 --- a/Bugzilla/Attachment/PatchReader.pm +++ b/Bugzilla/Attachment/PatchReader.pm @@ -37,7 +37,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/attachment.cgi b/attachment.cgi index 69a69c7fd..2bc6e5454 100755 --- a/attachment.cgi +++ b/attachment.cgi @@ -427,9 +427,8 @@ sub diff { sub viewall { # Retrieve and validate parameters my $bug = Bugzilla::Bug->check(scalar $cgi->param('bugid')); - 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; @@ -605,7 +604,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); # We only want attachment IDs. @$bugattachments = map { $_->id } @$bugattachments; -- cgit v1.2.3-24-g4f1b