Fix bustage due to bug 453743: I have to exclude flags related to private attachments you cannot see

git-svn-id: svn://10.0.0.236/trunk@254120 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
lpsolit%gmail.com
2008-09-09 00:30:07 +00:00
parent 049a93b6c1
commit 98e5facc75

View File

@@ -577,6 +577,9 @@ sub get_attachments_by_bug {
my $flags = Bugzilla::Flag->match({ bug_id => $bug_id,
target_type => 'attachment' });
# Exclude flags for private attachments you cannot see.
@$flags = grep {exists $att{$_->attach_id}} @$flags;
push(@{$att{$_->attach_id}->{flags}}, $_) foreach @$flags;
$attachments = [sort {$a->id <=> $b->id} values %att];
}