summaryrefslogtreecommitdiffstats
path: root/Bugzilla/User.pm
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2010-02-02 18:39:16 +0100
committerFrédéric Buclin <LpSolit@gmail.com>2010-02-02 18:39:16 +0100
commit663c65a3bf61dc9f0ee09bf64a62c2249b383a76 (patch)
tree6371d0c3f33d4dc2cebda8d462964277aff6165e /Bugzilla/User.pm
parentb0642d67ae6a9a7e7bbb8b8dc7a832c26bb211af (diff)
downloadbugzilla-663c65a3bf61dc9f0ee09bf64a62c2249b383a76.tar.gz
bugzilla-663c65a3bf61dc9f0ee09bf64a62c2249b383a76.tar.xz
Bug 543500: Cannot add/edit components anymore (regression in user matching)
r/a=mkanat
Diffstat (limited to 'Bugzilla/User.pm')
-rw-r--r--Bugzilla/User.pm24
1 files changed, 12 insertions, 12 deletions
diff --git a/Bugzilla/User.pm b/Bugzilla/User.pm
index d1e4694ec..244bc5b94 100644
--- a/Bugzilla/User.pm
+++ b/Bugzilla/User.pm
@@ -1197,25 +1197,21 @@ sub match_field {
}
$raw_field = clean_text($raw_field || '');
- # Tolerate fields that do not exist (in case you specify
- # e.g. the QA contact, and it's currently not in use).
- next unless ($raw_field && $raw_field ne '');
-
- my @queries = ();
-
# Now we either split $raw_field by spaces/commas and put the list
# into @queries, or in the case of fields which only accept single
# entries, we simply use the verbatim text.
-
- # single field
+ my @queries;
if ($fields->{$field}->{'type'} eq 'single') {
@queries = ($raw_field);
-
- # multi-field
+ # We will repopulate it later if a match is found, else it must
+ # be set to an empty string so that the field remains defined.
+ $data->{$field} = '';
}
elsif ($fields->{$field}->{'type'} eq 'multi') {
@queries = split(/[\s,;]+/, $raw_field);
-
+ # We will repopulate it later if a match is found, else it must
+ # be undefined.
+ delete $data->{$field};
}
else {
# bad argument
@@ -1225,6 +1221,10 @@ sub match_field {
});
}
+ # Tolerate fields that do not exist (in case you specify
+ # e.g. the QA contact, and it's currently not in use).
+ next unless (defined $raw_field && $raw_field ne '');
+
my $limit = 0;
if ($params->{'maxusermatches'}) {
$limit = $params->{'maxusermatches'} + 1;
@@ -1284,7 +1284,7 @@ sub match_field {
if ($fields->{$field}->{'type'} eq 'single') {
$data->{$field} = $logins[0] || '';
}
- else {
+ elsif (scalar @logins) {
$data->{$field} = \@logins;
}
}