]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 305993: The requestee field may be omitted even when a requestee is already set...
authorlpsolit%gmail.com <>
Thu, 6 Aug 2009 02:18:49 +0000 (02:18 +0000)
committerlpsolit%gmail.com <>
Thu, 6 Aug 2009 02:18:49 +0000 (02:18 +0000)
Bugzilla/Bug.pm
attachment.cgi

index 64627f4e91a87e17e084448f66c93080fb59c9f8..567c130f4a0b217e4b6d5a1547d09fd4fe83784b 100644 (file)
@@ -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'};
 }
index b62e4f23cc0e1fd07668c88643ea47da5f7db2db..8614026db59a84ae7525154f688be46d606b42c1 100755 (executable)
@@ -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;