quicksearch shouldn't treat apostrophes as quote characters

RESOLVED FIXED in Bugzilla 4.4

Status

()

Bugzilla
Query/Bug List
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: glob, Assigned: glob)

Tracking

unspecified
Bugzilla 4.4
Bug Flags:
approval +
approval4.4 +

Details

Attachments

(1 attachment, 2 obsolete attachments)

(Assignee)

Description

4 years ago
if you perform a quicksearch for a word with an apostrophe, you get the following error:

> Bugzilla is unable to parse your query correctly: can't.
> If you use quotes to enclose strings, make sure both quotes are present.
> If you really want to look for a quote in a string, type \" instead of ".
> For instance, "I'm so \"special\", really" (with quotes) will be interpreted
> as I'm so "special", really. 

this is counter-intuitive and painful.

" should be the only valid quote character.


this behaviour was changed by bugzilla 4.2 -- older versions don't treat ' as a quote character.
(Assignee)

Comment 1

4 years ago
Created attachment 755773 [details] [diff] [review]
patch v1
Assignee: query-and-buglist → glob
Attachment #755773 - Flags: review?(LpSolit)
(Assignee)

Comment 2

4 years ago
>     # to sanely search for contradictions. As this behavour isn't

of course i mean contractions.

Comment 3

4 years ago
(In reply to Byron Jones ‹:glob› from comment #0)
> this behaviour was changed by bugzilla 4.2 -- older versions don't treat '
> as a quote character.

4.2 correctly parses strings. 4.0 and older were totally broken.
OS: Mac OS X → All
Hardware: x86 → All

Comment 4

4 years ago
Comment on attachment 755773 [details] [diff] [review]
patch v1

This patch is useless. parse_line() does its job correctly. If I type:

"no, I can't"

(with quotes) in the QS field, then ' isn't seen as a quote character. Same if I type:

summary:"no, I can't"

Same if I type:

summary:'double quote " is legal'


Typing a whole string or a word containing quotes without quotes is a syntax error, IMO. Also, I use single quotes as separator if I want to look for double quotes inside strings and vice versa, and so your patch would break that.

This bug is WONTFIX to me, else you will break the current behavior for those who use single quotes as separator, e.g. in the case I mentioned above.
Attachment #755773 - Flags: review?(LpSolit) → review-
(Assignee)

Comment 5

4 years ago
i think the instances of people using an apostrophe in a word contraction would far exceed that of people using them as a quote character.  i don't think it's unreasonable to expect to be able to type common english words into a search field without needing to escape them.
I think it's fine to treat them as quote characters, if they have whitespace or begining/end of the string on at least one side of them.  Embedded in a word is obviously being used as an apostrophe.
(Assignee)

Comment 7

4 years ago
Created attachment 796772 [details] [diff] [review]
877545_2.patch

this revision treats apostrophes as quotes only on string or word boundaries.
Attachment #755773 - Attachment is obsolete: true
Attachment #796772 - Flags: review?(simon)

Comment 8

4 years ago
(In reply to Byron Jones ‹:glob› from comment #2)
> >     # to sanely search for contradictions. As this behavour isn't
> 
> of course i mean contractions.

You still didn't fix this typo.

Comment 9

4 years ago
Comment on attachment 796772 [details] [diff] [review]
877545_2.patch

QS is totally broken. It's now unable to parse foo:can't correctly. foo: is no longer seen as a field name.
Attachment #796772 - Flags: review?(simon) → review-
(Assignee)

Comment 10

4 years ago
Created attachment 797072 [details] [diff] [review]
877545_3.patch
Attachment #796772 - Attachment is obsolete: true
Attachment #797072 - Flags: review?(simon)
(Assignee)

Comment 11

4 years ago
amusing side-note: the sample query in the "unbalanced quotes" error has unbalanced quotes due to this bug:

If you use quotes to enclose strings, make sure both quotes are present. If you really want to look for a quote in a string, type \" instead of ". For instance, "I'm so \"special\", really" (with quotes) will be interpreted as I'm so "special", really.

Comment 12

4 years ago
Comment on attachment 797072 [details] [diff] [review]
877545_3.patch

I don't think it is working correct. If I quick search "ALL summary:bug" (without quotes) it returns what I expect.

If I quick search "ALL summary:it's" (again without quotes), it searches:

    Product: summary:it's
    Component: summary:it's
    Alias: summary:it's
    Summary: summary:it's
    Whiteboard: summary:it's

which seems incorrect.
Attachment #797072 - Flags: review?(simon) → review-
(Assignee)

Comment 13

4 years ago
(In reply to Simon Green from comment #12)
> I don't think it is working correct. If I quick search "ALL summary:bug"
> (without quotes) it returns what I expect.
> 
> If I quick search "ALL summary:it's" (again without quotes), it searches:
> 
>     Product: summary:it's
>     Component: summary:it's
>     Alias: summary:it's
>     Summary: summary:it's
>     Whiteboard: summary:it's
> 
> which seems incorrect.

odd, when i perform that search: buglist.cgi?quicksearch=ALL+summary%3Ait's
it searches: Summary: it's

are you able to provide the query_string which buglist.cgi is getting?

Updated

4 years ago
Attachment #797072 - Flags: review- → review+

Comment 14

4 years ago
(In reply to Byron Jones ‹:glob› from comment #13)
> odd, when i perform that search: buglist.cgi?quicksearch=ALL+summary%3Ait's
> it searches: Summary: it's

Odd indeed. When I tried it again this morning, it worked as expected.
 
Have changed my review decision.
Status: NEW → ASSIGNED
Flags: approval?
Flags: approval4.4?
Target Milestone: --- → Bugzilla 4.4
(Assignee)

Updated

4 years ago
Flags: approval?
Flags: approval4.4?
Flags: approval4.4+
Flags: approval+
(Assignee)

Comment 15

4 years ago
Committing to: bzr+ssh://bjones%40mozilla.com@bzr.mozilla.org/bugzilla/trunk/
modified Bugzilla/Search/Quicksearch.pm
Committed revision 8739.

Committing to: bzr+ssh://bjones%40mozilla.com@bzr.mozilla.org/bugzilla/4.4/
modified Bugzilla/Search/Quicksearch.pm
Committed revision 8607.
Status: ASSIGNED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
(Assignee)

Updated

4 years ago
Blocks: 918647
You need to log in before you can comment on or make changes to this bug.