Page MenuHomePhabricator

Redirect user to Special:Search when blank search performed
Closed, ResolvedPublic


If the user doesn't enter anything into the box before pressing
"Search", take him to [[Special:Search]], instead of the Main Page.

Version: unspecified
Severity: enhancement



Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:30 PM
bzimport set Reference to bz8054.
bzimport added a subscriber: Unknown Object (MLST).

lcarsdata wrote:

I agree this is much more intuitive and I find myself using the search button all
the time to get to the search page and ending up at the main page.

villadavida wrote:

First I'm new here, but please explain. I press Go or Search on Wikipedia and
Wiktionary and it already directs to the search page. It would be very nice though to
be able to restrict the namespaces from that page. Right now you have to do whatever
you've defined as your default search (or the default for default searches for those
who haven't edited their preferences) which is annoying when the servers are
overloaded. Is this comment mis-placed?

David, I see what you mean; go ahead and enter a new bug for that issue.
This bug will be closed once we work out the original complaint, which is separate,
so it's best to keep them apart for individual tracking.

villadavida wrote:

Bug 8444 submitted. ~~~~

As a guess, the problem is that the action URL on the skin's mini search form
points directly at the Special:Search page. When using query-string based
$wgArticlePath, this means the title is lost during form submission, as it's
replaced with the form's fields on the GET request.

Possible fixes:

  • change Wiki.php to accept a set, but empty 'search' parameter as valid to send

on to Special:Search behind the scenes

  • change skin so search form uses $wgScript and passes Special:Search in title


The first will not change URLs on existing wikis using pretty urls (pathinfo
titles) but will continue to spit out arguably wrong code for ugly urls (query
string titles).

The second will change search URLs to be slightly uglier on pretty-url wikis,
but they'll work more reliably all around. This also avoids the not uncommon
problem with rewrite rules being set up that overwrite the query string, as that
breaks the pretty URLs to Special:Search by ignoring the search parameters.

The two proposed fixes are also not mutually exclusive; they could both be done,
as both are arguably correct and orthogonal.

Fixed in r24207. Now checking for presence of the parameter, even if it's blank.