summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/RedHat/Extension.pm')
-rw-r--r--extensions/RedHat/Extension.pm43
1 files changed, 26 insertions, 17 deletions
diff --git a/extensions/RedHat/Extension.pm b/extensions/RedHat/Extension.pm
index 0a65ddbd1..22eae68a5 100644
--- a/extensions/RedHat/Extension.pm
+++ b/extensions/RedHat/Extension.pm
@@ -655,6 +655,10 @@ sub bug_filter_change {
}
## REDHAT EXTENSION END 915533
+ if ($field eq 'longdescs.extra_groups' && !$user->is_insider) {
+ $$visible = 0;
+ }
+
return;
}
@@ -1079,22 +1083,6 @@ sub bug_before_set_all {
}
## REDHAT EXTENSION END 798022
- ## REDHAT EXTENSION START 1824881
- if ($user->is_insider) {
- foreach my $key (keys %$input) {
- if ($key =~ /defined_extra_private_groups_(\d+)$/) {
- my $comment_id = $1;
- my $com_groups = [];
- if (exists $input->{"extra_private_groups_$comment_id"}) {
- $com_groups = $input->{"extra_private_groups_$comment_id"};
- $com_groups = [$com_groups] if (ref($com_groups) ne 'ARRAY');
- }
- $bug->edit_private_groups($comment_id, $com_groups);
- }
- }
- }
- ## REDHAT EXTENSION END 1824881
-
return;
}
@@ -1243,6 +1231,8 @@ sub bug_start_of_update {
my $changes = $args->{changes};
my $delta_ts = $args->{timestamp};
my $dbh = Bugzilla->dbh;
+ my $input = Bugzilla->input_params;
+ my $user = Bugzilla->user;
## RED HAT EXTENSION START 1174396
if ($bug->product_obj->name eq 'Fedora') {
@@ -1458,10 +1448,29 @@ sub bug_start_of_update {
## REDHAT EXTENSION START 420461
## REDHAT EXTENSION START 1824881
+ if ($user->is_insider) {
+ foreach my $key (keys %$input) {
+ if ($key =~ /defined_extra_private_groups_(\d+)$/) {
+ my $comment_id = $1;
+ my $com_groups = [];
+ if (exists $input->{"extra_private_groups_$comment_id"}) {
+ $com_groups = $input->{"extra_private_groups_$comment_id"};
+ $com_groups = [$com_groups] if (ref($com_groups) ne 'ARRAY');
+ }
+ $bug->edit_private_groups($comment_id, $com_groups);
+ }
+ }
+ }
my $edited_comment_private_groups = 0;
foreach my $comment (@{$bug->{edited_comment_private_groups} || []}) {
- $changes->{'longdesc'} = [$comment->{count}, 'comment private groups updated'];
+ LogActivityEntry(
+ $bug->id, "longdescs.extra_groups",
+ join(', ', @{$comment->{removed}}),
+ join(', ', @{$comment->{added}}),
+ $user->id, $delta_ts, $comment->{comment_id}
+ );
}
+
delete $bug->{edited_comment_private_groups}; # delete in case $bug->update is called again.
## REDHAT EXTENSION START 1824881