Closed Bug 362436 Opened 18 years ago Closed 17 years ago

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

Categories

(Bugzilla :: Query/Bug List, defect)

2.22
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 3.0

People

(Reporter: prasad.online, Assigned: michael.j.tosh)

References

Details

Attachments

(1 file)

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
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
(In reply to comment #1)
> Is there any good reason to convert '---' into ''?

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

Severity: normal → blocker
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
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) . ")";
             }
         },
Assuming resolution is the ONLY time you need to convert '---' to '', here is a patch built for 3.1.2
Attachment #283601 - Flags: review?
Attachment #283601 - Flags: review? → review?(mkanat)
Blocks: 398557
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.)
Attachment #283601 - Flags: review?(mkanat) → review?(justdave)
Comment on attachment 283601 [details] [diff] [review]
Patch for Bugzilla/Search.pm

joel, could you review this one-liner?
Attachment #283601 - Flags: review?(bugreport)
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?
Flags: approval?
Flags: approval3.0?
Flags: approval3.0+
Flags: approval+
Can someone handle checking in this code?  I am not able.
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
Closed: 17 years ago
Resolution: --- → FIXED
Summary: I am not able to search if version is "---" → Allow to search for '---' in versions and milestones
Keywords: relnote
I've decided this isn't important enough to relnote.
Keywords: relnote
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.