Commit db2e681e authored by Frédéric Buclin's avatar Frédéric Buclin Committed by Max Kanat-Alexander

Bug 534057: Auto-completion no longer works in email_in.pl

Patch by Frédéric Buclin <LpSolit@gmail.com> r/a=mkanat
parent 2502c9ff
...@@ -790,9 +790,9 @@ sub extract_flags_from_cgi { ...@@ -790,9 +790,9 @@ sub extract_flags_from_cgi {
my ($class, $bug, $attachment, $vars, $skip) = @_; my ($class, $bug, $attachment, $vars, $skip) = @_;
my $cgi = Bugzilla->cgi; my $cgi = Bugzilla->cgi;
my $match_status = Bugzilla::User::match_field($cgi, { my $match_status = Bugzilla::User::match_field({
'^requestee(_type)?-(\d+)$' => { 'type' => 'multi' }, '^requestee(_type)?-(\d+)$' => { 'type' => 'multi' },
}, $skip); }, undef, $skip);
$vars->{'match_field'} = 'requestee'; $vars->{'match_field'} = 'requestee';
if ($match_status == USER_MATCH_FAILED) { if ($match_status == USER_MATCH_FAILED) {
......
...@@ -118,7 +118,7 @@ if ($action eq 'add') { ...@@ -118,7 +118,7 @@ if ($action eq 'add') {
if ($action eq 'new') { if ($action eq 'new') {
check_token_data($token, 'add_component'); check_token_data($token, 'add_component');
# Do the user matching # Do the user matching
Bugzilla::User::match_field ($cgi, { Bugzilla::User::match_field ({
'initialowner' => { 'type' => 'single' }, 'initialowner' => { 'type' => 'single' },
'initialqacontact' => { 'type' => 'single' }, 'initialqacontact' => { 'type' => 'single' },
'initialcc' => { 'type' => 'multi' }, 'initialcc' => { 'type' => 'multi' },
...@@ -219,7 +219,7 @@ if ($action eq 'edit') { ...@@ -219,7 +219,7 @@ if ($action eq 'edit') {
if ($action eq 'update') { if ($action eq 'update') {
check_token_data($token, 'edit_component'); check_token_data($token, 'edit_component');
# Do the user matching # Do the user matching
Bugzilla::User::match_field ($cgi, { Bugzilla::User::match_field ({
'initialowner' => { 'type' => 'single' }, 'initialowner' => { 'type' => 'single' },
'initialqacontact' => { 'type' => 'single' }, 'initialqacontact' => { 'type' => 'single' },
'initialcc' => { 'type' => 'multi' }, 'initialcc' => { 'type' => 'multi' },
......
...@@ -193,7 +193,7 @@ if ($cgi->param('update')) { ...@@ -193,7 +193,7 @@ if ($cgi->param('update')) {
} }
} }
if (scalar %{$arglist}) { if (scalar %{$arglist}) {
&Bugzilla::User::match_field($cgi, $arglist); Bugzilla::User::match_field($arglist);
} }
for my $sid (@scheduleids) { for my $sid (@scheduleids) {
......
...@@ -152,6 +152,17 @@ sub post_bug { ...@@ -152,6 +152,17 @@ sub post_bug {
$fields->{$field} = undef if !exists $fields->{$field}; $fields->{$field} = undef if !exists $fields->{$field};
} }
my ($retval, $non_conclusive_fields) =
Bugzilla::User::match_field({
'assigned_to' => { 'type' => 'single' },
'qa_contact' => { 'type' => 'single' },
'cc' => { 'type' => 'multi' }
}, $fields, MATCH_SKIP_CONFIRM);
if ($retval != USER_MATCH_SUCCESS) {
ThrowUserError('user_match_too_many', {fields => $non_conclusive_fields});
}
my $bug = Bugzilla::Bug->create($fields); my $bug = Bugzilla::Bug->create($fields);
debug_print("Created bug " . $bug->id); debug_print("Created bug " . $bug->id);
return ($bug, $bug->comments->[0]); return ($bug, $bug->comments->[0]);
......
...@@ -85,7 +85,7 @@ if ($token) { ...@@ -85,7 +85,7 @@ if ($token) {
} }
# do a match on the fields if applicable # do a match on the fields if applicable
Bugzilla::User::match_field ($cgi, { Bugzilla::User::match_field ({
'cc' => { 'type' => 'multi' }, 'cc' => { 'type' => 'multi' },
'assigned_to' => { 'type' => 'single' }, 'assigned_to' => { 'type' => 'single' },
'qa_contact' => { 'type' => 'single' }, 'qa_contact' => { 'type' => 'single' },
......
...@@ -142,7 +142,7 @@ if (defined $cgi->param('dontchange')) { ...@@ -142,7 +142,7 @@ if (defined $cgi->param('dontchange')) {
} }
# do a match on the fields if applicable # do a match on the fields if applicable
Bugzilla::User::match_field($cgi, { Bugzilla::User::match_field({
'qa_contact' => { 'type' => 'single' }, 'qa_contact' => { 'type' => 'single' },
'newcc' => { 'type' => 'multi' }, 'newcc' => { 'type' => 'multi' },
'masscc' => { 'type' => 'multi' }, 'masscc' => { 'type' => 'multi' },
......
...@@ -63,7 +63,7 @@ unless (defined $cgi->param('requestee') ...@@ -63,7 +63,7 @@ unless (defined $cgi->param('requestee')
$fields->{'requestee'}->{'type'} = 'single'; $fields->{'requestee'}->{'type'} = 'single';
} }
Bugzilla::User::match_field($cgi, $fields); Bugzilla::User::match_field($fields);
if ($action eq 'queue') { if ($action eq 'queue') {
queue(); queue();
......
...@@ -1628,6 +1628,12 @@ ...@@ -1628,6 +1628,12 @@
<tt>[% name FILTER html %]</tt> does not exist or you are not allowed <tt>[% name FILTER html %]</tt> does not exist or you are not allowed
to see that user. to see that user.
[% ELSIF error == "user_match_too_many" %]
[% title = "No Conclusive Match" %]
[% terms.Bugzilla %] cannot make a conclusive match for one or more
of the names and/or email addresses you entered for
the [% fields.join(', ') FILTER html %] field(s).
[% ELSIF error == "user_not_insider" %] [% ELSIF error == "user_not_insider" %]
[% title = "User Not In Insidergroup" %] [% title = "User Not In Insidergroup" %]
Sorry, but you are not allowed to (un)mark comments or attachments Sorry, but you are not allowed to (un)mark comments or attachments
......
...@@ -247,7 +247,7 @@ sub SaveEmail { ...@@ -247,7 +247,7 @@ sub SaveEmail {
my $cgi = Bugzilla->cgi; my $cgi = Bugzilla->cgi;
my $user = Bugzilla->user; my $user = Bugzilla->user;
Bugzilla::User::match_field($cgi, { 'new_watchedusers' => {'type' => 'multi'} }); Bugzilla::User::match_field({ 'new_watchedusers' => {'type' => 'multi'} });
########################################################################### ###########################################################################
# Role-based preferences # Role-based preferences
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment