Edgewall Software

Opened 15 years ago

Closed 15 years ago

#6131 closed defect (fixed)

layout.html does not honor default flag returned by get_search_filters

Reported by: ben@… Owned by: Christian Boos
Priority: normal Milestone: 0.11
Component: search system Version: devel
Severity: minor Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:


Clicking on search in the nav bar takes one to a search page on which each search component is given a checkbox; the initial state of that checkbox is determined by the 'default' flag returned by get_search_filters of the matching ISearchSource plugin.

On the other hand, using the search field in the header of every Trac page yields a search in wiki, changesets, and tickets; this is hardcoded in layout.html.

I believe that the default behavior of the global search field should be the same as the default behavior of the search page; this is currently only true if no additional search sources are installed.

Attachments (0)

Change History (4)

comment:1 by osimons <simon-code@…>, 15 years ago

Version: devel

I agree. Hadn't noticed it before today either, but it does make sense seeing that is the default for Search.

Here is the simple patch that removes the filters in the layout.html template, and the SearchModule already adds all filters when none is specified - returning a full search result from all sources:

  • (a) layout.html vs. (b) (clipboard)

    a b  
    4747        <label for="proj-search">Search:</label>
    4848        <input type="text" id="proj-search" name="q" size="18" accesskey="f" value="" />
    4949        <input type="submit" value="Search" />
    50         <input type="hidden" name="wiki" value="on" />
    51         <input type="hidden" name="changeset" value="on" />
    52         <input type="hidden" name="ticket" value="on" />
    5350      </div></form>
    5451      ${navigation('metanav')}
    5552    </div>

comment:2 by osimons <simon-code@…>, 15 years ago

Actually, seeing header.cs is still included with 0.11dev for compatibility, the change also needs to be done in that template.

The diff below is also tested on 0.10.4, and works equally well there - could be added 0.10-stable branch as well to keep header.cs in sync until it one day is removed for good.

  • (a) header.cs vs. (b) (clipboard)

    a b  
    4242  <label for="proj-search">Search:</label>
    4343  <input type="text" id="proj-search" name="q" size="10" accesskey="f" value="" />
    4444  <input type="submit" value="Search" />
    45   <input type="hidden" name="wiki" value="on" />
    46   <input type="hidden" name="changeset" value="on" />
    47   <input type="hidden" name="ticket" value="on" />
    4845 </div><?cs /if ?>

comment:3 by Christian Boos, 15 years ago

Milestone: 0.11
Owner: changed from Jonas Borgström to Christian Boos
Severity: normalminor
Status: newassigned

Sure, good idea. I just tested the above changes and they work as expected. I don't think it's worth porting on 0.10-stable though.

comment:4 by Christian Boos, 15 years ago

Resolution: fixed
Status: assignedclosed

Fixed in r6049.

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Christian Boos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christian Boos 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.