From 5f2a455c24b4b6d4dc2ac2b59fc47f0c0f2e5bc6 Mon Sep 17 00:00:00 2001 From: Max Kanat-Alexander Date: Sat, 22 May 2010 22:09:43 -0700 Subject: Bug 556397: Move the setting of single-bug fields from process_bug.cgi into Bugzilla::Bug::set_all r=dkl, a=mkanat --- Bugzilla/Bug.pm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'Bugzilla/Bug.pm') diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index dcf3f96da..c1f4dc12f 100644 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -1968,7 +1968,6 @@ sub set_all { $self->set_custom_field($field, $params->{$fname}); } } - } sub set_alias { $_[0]->set('alias', $_[1]); } @@ -1988,6 +1987,15 @@ sub set_cclist_accessible { $_[0]->set('cclist_accessible', $_[1]); } sub set_comment_is_private { my ($self, $comment_id, $isprivate) = @_; return unless Bugzilla->user->is_insider; + + # We also allow people to pass in a hash of comment ids to update. + if (ref $comment_id) { + while (my ($id, $is) = each %$comment_id) { + $self->set_comment_is_private($id, $is); + } + return; + } + my ($comment) = grep($comment_id == $_->id, @{ $self->comments }); ThrowUserError('comment_invalid_isprivate', { id => $comment_id }) if !$comment; -- cgit v1.2.3-24-g4f1b