summaryrefslogtreecommitdiffstats
path: root/process_bug.cgi
diff options
context:
space:
mode:
authorByron Jones <glob@mozilla.com>2014-08-26 06:51:09 +0200
committerByron Jones <glob@mozilla.com>2014-08-26 06:51:09 +0200
commitd5c1d67198505cc72845d512628852ace9ce799e (patch)
treed50c9f7d7cc0a198e03840b40649a7d389f9ecfd /process_bug.cgi
parent83c1212ce5f8c90d200d7480142ac31a9b4545c1 (diff)
downloadbugzilla-d5c1d67198505cc72845d512628852ace9ce799e.tar.gz
bugzilla-d5c1d67198505cc72845d512628852ace9ce799e.tar.xz
Bug 1051655: mentor field updated/reset when a bug is updated as a result of a change on a different bug (eg. see also, duplicate)
Diffstat (limited to 'process_bug.cgi')
-rwxr-xr-xprocess_bug.cgi23
1 files changed, 17 insertions, 6 deletions
diff --git a/process_bug.cgi b/process_bug.cgi
index 20875fb29..39823f88e 100755
--- a/process_bug.cgi
+++ b/process_bug.cgi
@@ -58,6 +58,7 @@ use Bugzilla::Keyword;
use Bugzilla::Flag;
use Bugzilla::Status;
use Bugzilla::Token;
+use Bugzilla::Hook;
use List::MoreUtils qw(firstidx);
use Storable qw(dclone);
@@ -133,12 +134,15 @@ if (defined $cgi->param('dontchange')) {
}
# do a match on the fields if applicable
-Bugzilla::User::match_field({
- 'qa_contact' => { 'type' => 'single' },
- 'newcc' => { 'type' => 'multi' },
- 'masscc' => { 'type' => 'multi' },
- 'assigned_to' => { 'type' => 'single' },
-});
+# BMO: allow extensions to define custom user fields
+my $user_match_fields = {
+ 'qa_contact' => { 'type' => 'single' },
+ 'newcc' => { 'type' => 'multi' },
+ 'masscc' => { 'type' => 'multi' },
+ 'assigned_to' => { 'type' => 'single' },
+};
+Bugzilla::Hook::process('bug_user_match_fields', { fields => $user_match_fields });
+Bugzilla::User::match_field($user_match_fields);
print $cgi->header() unless Bugzilla->usage_mode == USAGE_MODE_EMAIL;
@@ -371,6 +375,13 @@ foreach my $field (@custom_fields) {
}
}
+# BMO - add user_match_fields. it's important to source from input_params
+# instead of $cgi->param to ensure we get the correct value.
+foreach my $field (keys %$user_match_fields) {
+ next if exists $set_all_fields{$field};
+ $set_all_fields{$field} = Bugzilla->input_params->{$field} // [];
+}
+
# We are going to alter the list of removed groups, so we keep a copy here.
my @unchecked_groups = @$removed_groups;
foreach my $b (@bug_objects) {