Edgewall Software
Modify

Opened 17 years ago

Closed 17 years ago

#2320 closed defect (wontfix)

query string values are ignored during search

Reported by: mgsmith@… 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:

…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 Bruce Christensen <trac@…>, 17 years ago

The fields that you are talking about are submitted via a checkbox on an HTML form. The HTML 4.0 forms spec states:

Checkboxes (and radio buttons) are on/off switches that may be toggled by the user. A switch is "on" when the control element's checked attribute is set. When a form is submitted, only "on" checkbox controls can become successful.

So at least as far at HTML forms are concerned, a value of off should never be sent.

comment:2 by Christopher Lenz, 17 years ago

Resolution: wontfix
Status: newclosed

This works as intended. To exclude results of certain kinds, the parameter should be removed from the query string.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jonas Borgström.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jonas Borgström to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.