summaryrefslogtreecommitdiffstats
path: root/post_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 /post_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 'post_bug.cgi')
-rwxr-xr-xpost_bug.cgi14
1 files changed, 12 insertions, 2 deletions
diff --git a/post_bug.cgi b/post_bug.cgi
index a1ed77bac..ccdda3e2d 100755
--- a/post_bug.cgi
+++ b/post_bug.cgi
@@ -73,11 +73,14 @@ my $token = trim($cgi->param('token'));
check_token_data($token, 'create_bug', 'index.cgi');
# do a match on the fields if applicable
-Bugzilla::User::match_field ({
+# BMO: allow extensions to define custom user fields
+my $user_match_fields = {
'cc' => { 'type' => 'multi' },
'assigned_to' => { 'type' => 'single' },
'qa_contact' => { 'type' => 'single' },
-});
+};
+Bugzilla::Hook::process('bug_user_match_fields', { fields => $user_match_fields });
+Bugzilla::User::match_field($user_match_fields);
if (defined $cgi->param('maketemplate')) {
$vars->{'url'} = $cgi->canonicalise_query('token');
@@ -152,6 +155,13 @@ foreach my $field (@multi_selects) {
$bug_params{$field->name} = [$cgi->param($field->name)];
}
+# 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 $bug_params{$field};
+ $bug_params{$field} = Bugzilla->input_params->{$field} // [];
+}
+
my $bug = Bugzilla::Bug->create(\%bug_params);
# Get the bug ID back and delete the token used to create this bug.