diff options
author | Max Kanat-Alexander <mkanat@bugzilla.org> | 2010-08-02 00:48:57 +0200 |
---|---|---|
committer | Max Kanat-Alexander <mkanat@bugzilla.org> | 2010-08-02 00:48:57 +0200 |
commit | 21c69e6bf1158d1277fb7e1b4fab20a594876186 (patch) | |
tree | 2a770e6a678bfdf927040c302b8b254be1570559 | |
parent | 85c092b03849942d2afcb1e06035cb890f8436d7 (diff) | |
download | bugzilla-21c69e6bf1158d1277fb7e1b4fab20a594876186.tar.gz bugzilla-21c69e6bf1158d1277fb7e1b4fab20a594876186.tar.xz |
Bug 581327: The patch to allow commas in Product (etc.) names broke the
entering of comma-separated values in other search fields, like bug_id.
So now we split on commas in text fields, but not for <select> fields.
r=mkanat, a=mkanat (module owner)
-rw-r--r-- | Bugzilla/Search.pm | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm index 59a358a6f..3408c2d55 100644 --- a/Bugzilla/Search.pm +++ b/Bugzilla/Search.pm @@ -1210,7 +1210,21 @@ sub _parse_basic_fields { next if !@values; my $operator = $params->{"${param_name}_type"} || 'anyexact'; $operator = 'matches' if $operator eq 'content'; - push(@charts, [$field_name, $operator, \@values]); + # Fields that are displayed as multi-selects are passed as arrays, + # so that they can properly search values that contain commas. + # However, other fields are sent as strings, so that they are properly + # split on commas if required. + my $field = $chart_fields->{$field_name}; + my $pass_value; + if ($field->is_select or $field->name eq 'version' + or $field->name eq 'target_milestone') + { + $pass_value = \@values; + } + else { + $pass_value = join(',', @values); + } + push(@charts, [$field_name, $operator, $pass_value]); } return @charts; } |