Modify ↓
Opened 19 years ago
Closed 19 years ago
#2320 closed defect (wontfix)
query string values are ignored during search
Reported by: | Owned by: | Jonas Borgström | |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | search system | Version: | 0.8.4 |
Severity: | normal | Keywords: | search query string |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
When performing a seach, the values of the query string are ignored, only their existence is tested.
For example, these two search should both search just the tickets:
- http://projects.edgewall.com/trac/search?q=email&wiki=off&changeset=off&ticket=on
- http://projects.edgewall.com/trac/search?q=emailticket=on
…but the first one search tickets, wiki, and changesets.
Here is a patch to C:\Python23\Lib\site-packages\trac\Seach.py (around line 200)…
- before:
if self.args.has_key('q'): query = self.args.get('q') self.req.hdf.setValue('title', 'Search Results') self.req.hdf.setValue('search.q', query.replace('"', """)) tickets = self.args.has_key('ticket') changesets = self.args.has_key('changeset') wiki = self.args.has_key('wiki')
- after:
if self.args.has_key('q'): query = self.args.get('q') self.req.hdf.setValue('title', 'Search Results') self.req.hdf.setValue('search.q', query.replace('"', """)) tickets = self.args.get('ticket') == "on" changesets = self.args.get('changeset') == "on" wiki = self.args.get('wiki') == "on"
Attachments (0)
Change History (2)
comment:1 by , 19 years ago
comment:2 by , 19 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
This works as intended. To exclude results of certain kinds, the parameter should be removed from the query string.
Note:
See TracTickets
for help on using tickets.
The fields that you are talking about are submitted via a checkbox on an HTML form. The HTML 4.0 forms spec states:
So at least as far at HTML forms are concerned, a value of
off
should never be sent.