Commit cc06a324 authored by Frédéric Buclin's avatar Frédéric Buclin

2nd part of bug 731559: fix get_attachments_by_bug() everywhere

a=LpSolit
parent 272f3803
...@@ -37,7 +37,7 @@ sub process_diff { ...@@ -37,7 +37,7 @@ sub process_diff {
if ($lc->{interdiffbin} && $lc->{diffpath}) { if ($lc->{interdiffbin} && $lc->{diffpath}) {
# Get the list of attachments that the user can view in this bug. # Get the list of attachments that the user can view in this bug.
my @attachments = my @attachments =
@{Bugzilla::Attachment->get_attachments_by_bug($attachment->bug_id)}; @{Bugzilla::Attachment->get_attachments_by_bug($attachment->bug)};
# Extract patches only. # Extract patches only.
@attachments = grep {$_->ispatch == 1} @attachments; @attachments = grep {$_->ispatch == 1} @attachments;
# We want them sorted from newer to older. # We want them sorted from newer to older.
......
...@@ -427,9 +427,8 @@ sub diff { ...@@ -427,9 +427,8 @@ sub diff {
sub viewall { sub viewall {
# Retrieve and validate parameters # Retrieve and validate parameters
my $bug = Bugzilla::Bug->check(scalar $cgi->param('bugid')); 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. # Ignore deleted attachments.
@$attachments = grep { $_->datasize } @$attachments; @$attachments = grep { $_->datasize } @$attachments;
...@@ -605,7 +604,7 @@ sub edit { ...@@ -605,7 +604,7 @@ sub edit {
my $attachment = validateID(); my $attachment = validateID();
my $bugattachments = my $bugattachments =
Bugzilla::Attachment->get_attachments_by_bug($attachment->bug_id); Bugzilla::Attachment->get_attachments_by_bug($attachment->bug);
# We only want attachment IDs. # We only want attachment IDs.
@$bugattachments = map { $_->id } @$bugattachments; @$bugattachments = map { $_->id } @$bugattachments;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment