Opened 17 years ago
Closed 17 years ago
#6131 closed defect (fixed)
layout.html does not honor default flag returned by get_search_filters
Reported by: | 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: |
Description
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 , 17 years ago
Version: | → devel |
---|
comment:2 by , 17 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 42 42 <label for="proj-search">Search:</label> 43 43 <input type="text" id="proj-search" name="q" size="10" accesskey="f" value="" /> 44 44 <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" />48 45 </div><?cs /if ?> 49 46 </form>
comment:3 by , 17 years ago
Milestone: | → 0.11 |
---|---|
Owner: | changed from | to
Severity: | normal → minor |
Status: | new → assigned |
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.
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 theSearchModule
already adds all filters when none is specified - returning a full search result from all sources:(a) layout.html vs. (b) (clipboard)
<input type="hidden" name="wiki" value="on" /><input type="hidden" name="changeset" value="on" /><input type="hidden" name="ticket" value="on" />