Closed Bug 856158 Opened 11 years ago Closed 11 years ago

Flag and requestee shortcut for quicksearch breaks search terms containing ?

Categories

(Bugzilla :: Query/Bug List, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 4.4

People

(Reporter: dkl, Assigned: LpSolit)

References

Details

(Keywords: regression)

Attachments

(1 file, 1 obsolete file)

When http://bzr.mozilla.org/bugzilla/trunk/revision/6742 was introduced it no longer allows different search terms to include '?' otherwise they will be treated as flags which they are not.

For example the following quicksearch no longer works after upograding to 4.2:

ALL classification:"Client Software" OR classification:"Components" AND summary:"ABORT: Channel completed connect, but not connecting?: 'aChannel->mConnecting == CONNECTING_IN_PROGRESS'" OR comment:"ABORT: Channel completed connect, but not connecting?: 'aChannel->mConnecting == CONNECTING_IN_PROGRESS'"

The above search generates improperly:

Classification: Client Software
Classification: Components
Flags: summary:"ABORT: Channel completed connect, but not connecting?
Flag Requestee: : 'aChannel->mConnecting == CONNECTING_IN_PROGRESS'"
Flags: comment:"ABORT: Channel completed connect, but not connecting?
Flag Requestee: : 'aChannel->mConnecting == CONNECTING_IN_PROGRESS'"

Offending code:

sub _handle_field_names {
    my ($or_operand, $negate, $unknownFields, $ambiguous_fields) = @_;

    # Flag and requestee shortcut
    if ($or_operand =~ /^(?:flag:)?([^\?]+\?)([^\?]*)$/) {
        addChart('flagtypes.name', 'substring', $1, $negate);
        $chart++; $and = $or = 0; # Next chart for boolean AND
        addChart('requestees.login_name', 'substring', $2, $negate);
        return 1;
    }

Will need to see how to rework the regexp to not treat as a flag if a colon ':' comes before the '?' maybe if we do not think flagnames will ever have a ':' in it which we don't enforce.

Thoughts?
dkl
(In reply to David Lawrence [:dkl] from comment #0)
> When http://bzr.mozilla.org/bugzilla/trunk/revision/6742 was introduced it
> no longer allows different search terms to include '?' otherwise they will
> be treated as flags which they are not.

This patch is not the culprit. It landed in 3.6, see bug 490551, and neither 3.6 nor 4.0 are affected by this bug. So this is a regression in 4.2. I will investigate.
Assignee: query-and-buglist → LpSolit
Status: NEW → ASSIGNED
Keywords: regression
Target Milestone: --- → Bugzilla 4.2
The "culprit" is bug 554819 where we no longer call url_quote() via the buggy splitString() subroutine. So in 4.0 and older, "a?b" was replaced by a%3Fb and so didn't trigger the flag+requestee shortcuts. In 4.2, "a?b" is not encoded and trigger the flag+requestee shortcuts. The tricky part is that flag names such as |a:v"b:c?d| are legal, and so could totally confuse the parser. But that's the kind of edge cases which I don't really care about.
Depends on: 554819
Attached patch patch, v1 (obsolete) — Splinter Review
Attachment #731534 - Flags: review?(dkl)
Attachment #731534 - Flags: review?(dkl) → review?(glob)
this conflicts with my work on bug 828344, so i'll hold off on doing this review until that has been committed.
Bugzilla 4.2 is now restricted to security fixes only.
Target Milestone: Bugzilla 4.2 → Bugzilla 4.4
Attached patch patch, v1.1Splinter Review
I fixed bitrot.
Attachment #731534 - Attachment is obsolete: true
Attachment #731534 - Flags: review?(glob)
Attachment #758533 - Flags: review?(glob)
Comment on attachment 758533 [details] [diff] [review]
patch, v1.1

r=glob

>+        $chart++; $and = $or = 0;

break this into two lines before committing.
Attachment #758533 - Flags: review?(glob) → review+
Flags: approval4.4+
Flags: approval+
Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/trunk/
modified Bugzilla/Search/Quicksearch.pm
Committed revision 8636.

Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/4.4/
modified Bugzilla/Search/Quicksearch.pm
Committed revision 8568.
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: