From: Erik Bernhardson Date: Mon, 13 Jun 2016 16:41:03 +0000 (-0700) Subject: search: did you mean should always go to SERP X-Git-Tag: 1.31.0-rc.0~6505^2~1 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/pie.php?a=commitdiff_plain;h=3d3ad9083476953db08f41048460d87813c3db85;p=lhc%2Fweb%2Fwiklou.git search: did you mean should always go to SERP Did you mean had an odd inconcistency, where if you came to Special:Search from autocomplete and click a did you mean link to an exact title match, you would be sent to the page rather than a results page. This seems odd and inconsistent, so always provide the 'fulltext' parameter to disable the 'go' feature. Change-Id: I8c80505053cd04b67afbe2139415fb0a44d954b4 --- diff --git a/includes/specials/SpecialSearch.php b/includes/specials/SpecialSearch.php index b98ddda1af..a779b66e5d 100644 --- a/includes/specials/SpecialSearch.php +++ b/includes/specials/SpecialSearch.php @@ -485,7 +485,9 @@ class SpecialSearch extends SpecialPage { protected function getDidYouMeanHtml( SearchResultSet $textMatches ) { # mirror Go/Search behavior of original request .. $params = [ 'search' => $textMatches->getSuggestionQuery() ]; - if ( $this->fulltext != null ) { + if ( $this->fulltext === null ) { + $params['fulltext'] = 'Search'; + } else { $params['fulltext'] = $this->fulltext; } $stParams = array_merge( $params, $this->powerSearchOptions() ); @@ -519,7 +521,9 @@ class SpecialSearch extends SpecialPage { // Search instead for '$orig' $params = [ 'search' => $textMatches->getQueryAfterRewrite() ]; - if ( $this->fulltext != null ) { + if ( $this->fulltext === null ) { + $params['fulltext'] = 'Search'; + } else { $params['fulltext'] = $this->fulltext; } $stParams = array_merge( $params, $this->powerSearchOptions() );