diff options
author | lpsolit%gmail.com <> | 2009-08-06 04:18:49 +0200 |
---|---|---|
committer | lpsolit%gmail.com <> | 2009-08-06 04:18:49 +0200 |
commit | 8dc4b874a314a9ff4b32d3223fe481ef32a6a475 (patch) | |
tree | 9ba7736da23bc62f958f6d12d3302f7857532706 | |
parent | d0002e9626b97df6fad2c597b89c8ec31f7c308a (diff) | |
download | bugzilla-8dc4b874a314a9ff4b32d3223fe481ef32a6a475.tar.gz bugzilla-8dc4b874a314a9ff4b32d3223fe481ef32a6a475.tar.xz |
Bug 305993: The requestee field may be omitted even when a requestee is already set - Patch by Frédéric Buclin <LpSolit@gmail.com> a=LpSolit
-rw-r--r-- | Bugzilla/Bug.pm | 8 | ||||
-rwxr-xr-x | attachment.cgi | 10 |
2 files changed, 14 insertions, 4 deletions
diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index 64627f4e9..567c130f4 100644 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -2519,8 +2519,12 @@ sub any_flags_requesteeble { if exists $self->{'any_flags_requesteeble'}; return 0 if $self->{'error'}; - $self->{'any_flags_requesteeble'} = - grep($_->{'is_requesteeble'}, @{$self->flag_types}); + my $any_flags_requesteeble = + grep { $_->is_requestable && $_->is_requesteeble } @{$self->flag_types}; + # Useful in case a flagtype is no longer requestable but a requestee + # has been set before we turned off that bit. + $any_flags_requesteeble ||= grep { $_->requestee_id } @{$self->flags}; + $self->{'any_flags_requesteeble'} = $any_flags_requesteeble; return $self->{'any_flags_requesteeble'}; } diff --git a/attachment.cgi b/attachment.cgi index b62e4f23c..8614026db 100755 --- a/attachment.cgi +++ b/attachment.cgi @@ -400,7 +400,8 @@ sub enter { 'product_id' => $bug->product_id, 'component_id' => $bug->component_id}); $vars->{'flag_types'} = $flag_types; - $vars->{'any_flags_requesteeble'} = grep($_->is_requesteeble, @$flag_types); + $vars->{'any_flags_requesteeble'} = + grep { $_->is_requestable && $_->is_requesteeble } @$flag_types; $vars->{'token'} = issue_session_token('create_attachment:'); print $cgi->header(); @@ -542,7 +543,12 @@ sub edit { # We only want attachment IDs. @$bugattachments = map { $_->id } @$bugattachments; - $vars->{'any_flags_requesteeble'} = grep($_->is_requesteeble, @{$attachment->flag_types}); + my $any_flags_requesteeble = + grep { $_->is_requestable && $_->is_requesteeble } @{$attachment->flag_types}; + # Useful in case a flagtype is no longer requestable but a requestee + # has been set before we turned off that bit. + $any_flags_requesteeble ||= grep { $_->requestee_id } @{$attachment->flags}; + $vars->{'any_flags_requesteeble'} = $any_flags_requesteeble; $vars->{'attachment'} = $attachment; $vars->{'attachments'} = $bugattachments; |