summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Bugzilla/Attachment/PatchReader.pm2
-rw-r--r--Bugzilla/Bug.pm2
-rwxr-xr-xattachment.cgi5
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};