From d7db0c1d84c999b470d8f2c4ce870a012a4ce165 Mon Sep 17 00:00:00 2001 From: Dylan Hardison Date: Fri, 20 May 2016 16:24:23 -0400 Subject: Bug 1265392 - Clicking "stop following this bug" also turned off the 'restrict comments to users not in editbugs' flag --- extensions/RestrictComments/Extension.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'extensions') diff --git a/extensions/RestrictComments/Extension.pm b/extensions/RestrictComments/Extension.pm index 001332a8e..61a4912b3 100644 --- a/extensions/RestrictComments/Extension.pm +++ b/extensions/RestrictComments/Extension.pm @@ -13,6 +13,7 @@ use warnings; use base qw(Bugzilla::Extension); use Bugzilla::Constants; +use Bugzilla::Util qw(i_am_webservice); BEGIN { *Bugzilla::Bug::restrict_comments = \&_bug_restrict_comments; @@ -47,8 +48,9 @@ sub _can_restrict_comments { sub object_end_of_set_all { my ($self, $args) = @_; my $object = $args->{object}; - if ($self->_can_restrict_comments($object)) { - my $input = Bugzilla->input_params; + my $input = Bugzilla->input_params; + my $update_restrict_comments = !i_am_webservice() || exists $input->{restrict_comments}; + if ($update_restrict_comments && $self->_can_restrict_comments($object)) { $object->set('restrict_comments', $input->{restrict_comments} ? 1 : undef); } } -- cgit v1.2.3-24-g4f1b