Allow to search for '---' in versions and milestones

RESOLVED FIXED in Bugzilla 3.0

Status

()

Bugzilla
Query/Bug List
RESOLVED FIXED
11 years ago
9 years ago

People

(Reporter: Prasad Wani, Assigned: miketosh)

Tracking

2.22
Bugzilla 3.0
Bug Flags:
approval +
approval3.0 +

Details

Attachments

(1 attachment)

(Reporter)

Description

11 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.8) Gecko/20061025 Firefox/1.5.0.8
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.8) Gecko/20061025 Firefox/1.5.0.8

I setup the bugzilla 2.22 and having problem for finding the bug with version name as "---". There are already lots of bugs file under that version. But whenever I am using advance search and select version "---" its giving me Zaro results. But if i know the bug number it is able to find.

Reproducible: Always

Comment 1

11 years ago
I can reproduce the bug on tip.

The problem is that Search.pm uses 'anyexact' for fields having legal values...

    foreach my $field ($params->param()) {
        if (lsearch(\@legal_fields, $field) != -1) {
            push(@specialchart, [$field, "anyexact",
                                 join(',', $params->param($field))]);
        }
    }


... but the field value '---' is converted back to '' if the field is not a target milestone, explaining why the query returns no result with version = '---':

         ",anyexact" => sub {
             my @list;
             foreach my $w (split(/,/, $v)) {
                 if ($w eq "---" && $f !~ /milestone/) {
                     $w = "";
                 }
                 $q = $dbh->quote($w);
                 trick_taint($q);
                 push(@list, $q);
             }
             if (@list) {
                 $term = "$ff IN (" . join (',', @list) . ")";
             }
         },

Is there any good reason to convert '---' into ''?
Assignee: administration → query-and-buglist
Status: UNCONFIRMED → NEW
Component: Administration → Query/Bug List
Ever confirmed: true
OS: Windows XP → All
Hardware: PC → All
Version: unspecified → 2.22

Comment 2

11 years ago
(In reply to comment #1)
> Is there any good reason to convert '---' into ''?

  For resolution.
(Reporter)

Comment 3

11 years ago
How to resolve this problem because every time if I do any search with version == ---. You always get zarro bugs found!

(Reporter)

Updated

11 years ago
Severity: normal → blocker

Comment 4

11 years ago
This is not a blocker. You cannot currently search for --- in a field, and that's a known problem. Try renaming your version to "--" instead for now.
Severity: blocker → normal

Updated

10 years ago
Duplicate of this bug: 398600
(Assignee)

Comment 6

10 years ago
Instead of converting ALL non-targets to '', why not convert resolution only?  That would make more sense to me.

         ",anyexact" => sub {
             my @list;
             foreach my $w (split(/,/, $v)) {
                 if ($w eq "---" && $f ~ /resolution/) {
                     $w = "";
                 }
                 $q = $dbh->quote($w);
                 trick_taint($q);
                 push(@list, $q);
             }
             if (@list) {
                 $term = "$ff IN (" . join (',', @list) . ")";
             }
         },
(Assignee)

Comment 7

10 years ago
Created attachment 283601 [details] [diff] [review]
Patch for Bugzilla/Search.pm

Assuming resolution is the ONLY time you need to convert '---' to '', here is a patch built for 3.1.2
Attachment #283601 - Flags: review?
(Assignee)

Updated

10 years ago
Attachment #283601 - Flags: review? → review?(mkanat)
(Assignee)

Updated

10 years ago
Blocks: 398557

Comment 8

10 years ago
Comment on attachment 283601 [details] [diff] [review]
Patch for Bugzilla/Search.pm

I'm not qualified to review Search.pm--ask somebody else. (See the Reviewer List.)
(Assignee)

Updated

10 years ago
Attachment #283601 - Flags: review?(mkanat) → review?(justdave)

Comment 9

10 years ago
Comment on attachment 283601 [details] [diff] [review]
Patch for Bugzilla/Search.pm

joel, could you review this one-liner?
Attachment #283601 - Flags: review?(bugreport)

Updated

10 years ago
Assignee: query-and-buglist → michael.j.tosh
Target Milestone: --- → Bugzilla 3.0
Comment on attachment 283601 [details] [diff] [review]
Patch for Bugzilla/Search.pm

We should probably be more careful on field names... what if someone creates a custom field that happens to contain the word "resolution" ;)

But yes, having poked through the available values and how they're treated on the other fields, this is definitely the right fix.
Attachment #283601 - Flags: review?(justdave)
Attachment #283601 - Flags: review?(bugreport)
Attachment #283601 - Flags: review+
Flags: approval?
Flags: approval3.0?

Updated

10 years ago
Flags: approval?
Flags: approval3.0?
Flags: approval3.0+
Flags: approval+
(Assignee)

Comment 11

10 years ago
Can someone handle checking in this code?  I am not able.

Comment 12

10 years ago
tip:

Checking in Bugzilla/Search.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Search.pm,v  <--  Search.pm
new revision: 1.149; previous revision: 1.148
done

3.0.2:

Checking in Bugzilla/Search.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Search.pm,v  <--  Search.pm
new revision: 1.145.2.2; previous revision: 1.145.2.1
done
Status: NEW → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → FIXED
Summary: I am not able to search if version is "---" → Allow to search for '---' in versions and milestones

Updated

10 years ago
Keywords: relnote

Comment 13

9 years ago
I've decided this isn't important enough to relnote.
Keywords: relnote

Comment 14

9 years ago
Added to the release notes for Bugzilla 3.2 in a patch on bug 432331.
You need to log in before you can comment on or make changes to this bug.