summaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authorMax Kanat-Alexander <mkanat@bugzilla.org>2010-05-23 07:09:43 +0200
committerMax Kanat-Alexander <mkanat@bugzilla.org>2010-05-23 07:09:43 +0200
commit5f2a455c24b4b6d4dc2ac2b59fc47f0c0f2e5bc6 (patch)
treeb5aa0cf54dcb9600908e1b51c500bd46e423ced2 /Bugzilla
parent0481e9aa5d957665c206c9de1efc8c7f8c56cb4c (diff)
downloadbugzilla-5f2a455c24b4b6d4dc2ac2b59fc47f0c0f2e5bc6.tar.gz
bugzilla-5f2a455c24b4b6d4dc2ac2b59fc47f0c0f2e5bc6.tar.xz
Bug 556397: Move the setting of single-bug fields from process_bug.cgi
into Bugzilla::Bug::set_all r=dkl, a=mkanat
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/Bug.pm10
1 files changed, 9 insertions, 1 deletions
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;