summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authorDylan Hardison <dylan@mozilla.com>2016-05-20 22:24:23 +0200
committerDylan Hardison <dylan@mozilla.com>2016-05-20 22:24:45 +0200
commitd7db0c1d84c999b470d8f2c4ce870a012a4ce165 (patch)
tree79196549ad1cfbfa7d4db1111574206ba7c80fd5 /extensions
parent73fffe57d7604cd711a26130514aceeac12facb8 (diff)
downloadbugzilla-d7db0c1d84c999b470d8f2c4ce870a012a4ce165.tar.gz
bugzilla-d7db0c1d84c999b470d8f2c4ce870a012a4ce165.tar.xz
Bug 1265392 - Clicking "stop following this bug" also turned off the 'restrict comments to users not in editbugs' flag
Diffstat (limited to 'extensions')
-rw-r--r--extensions/RestrictComments/Extension.pm6
1 files changed, 4 insertions, 2 deletions
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);
}
}