[wp-trac] [WordPress Trac] #17016: Empty search not allowed - makes it hard to build an enhanced search page

WordPress Trac wp-trac at lists.automattic.com
Fri Apr 1 23:16:03 UTC 2011


#17016: Empty search not allowed - makes it hard to build an enhanced search page
-------------------------+-----------------------------
 Reporter:  jobjorn      |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Template     |    Version:  3.1
 Severity:  normal       |   Keywords:  has-patch
-------------------------+-----------------------------
 Hello all,

 I am building an enhanced search form for a recipe database (using a Star
 Trek LCARS-like interface!). The enhancement is primarily being able to
 select tags that the returned results should be tagged with. This is made
 possible in part through using query_posts(); in the landing page,
 search.php.

 However, what if you want to search for *just* tags, and no text? You want
 to look at what's tagged both "cheese" and "tomato", and see no need to
 enter any search term. The result is that {{{$_GET['s']}}} will be empty,
 and you will not get to search.php at all - and then you can't see your
 cheese+tomato recipes.

 This is because wp-includes/query.php uses {{{!empty}}} rather than
 {{{isset}}} when trying to figure out whether we want to see a search page
 attached or not.

 Extremely simple diff attached. If this solution is for some reason
 unacceptable, I would very much appreciate any ideas on how to work around
 the issue.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/17016>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list