diff options
author | Byron Jones <glob@mozilla.com> | 2014-08-26 06:51:09 +0200 |
---|---|---|
committer | Byron Jones <glob@mozilla.com> | 2014-08-26 06:51:09 +0200 |
commit | d5c1d67198505cc72845d512628852ace9ce799e (patch) | |
tree | d50c9f7d7cc0a198e03840b40649a7d389f9ecfd /post_bug.cgi | |
parent | 83c1212ce5f8c90d200d7480142ac31a9b4545c1 (diff) | |
download | bugzilla-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-x | post_bug.cgi | 14 |
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. |