r57986 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r57985‎ | r57986 | r57987 >
Date:18:44, 21 October 2009
Author:catrope
Status:ok
Tags:
Comment:
Split allowing &suggest requests in API opensearch from $wgEnableMWSuggest to a separate variable. This makes it possible to enable SimpleSearch (which uses API opensearch) but disable mwsuggest; enabling both seems to cause issues with the login form in Safari or Opera (don't remember which)
Modified paths:
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/api/ApiOpenSearch.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiOpenSearch.php
@@ -49,9 +49,8 @@
5050 $namespaces = $params['namespace'];
5151 $suggest = $params['suggest'];
5252
53 - // $wgEnableMWSuggest hit incoming when $wgEnableMWSuggest is
54 - // disabled
55 - if( $suggest && !$wgEnableMWSuggest )
 53+ // MWSuggest or similar hit
 54+ if( $suggest && !$wgEnableOpenSearchSuggest )
5655 $srchres = array();
5756 else {
5857 // Open search results may be stored for a very long
@@ -91,7 +90,7 @@
9291 'search' => 'Search string',
9392 'limit' => 'Maximum amount of results to return',
9493 'namespace' => 'Namespaces to search',
95 - 'suggest' => 'Do nothing if $wgEnableMWSuggest is false',
 94+ 'suggest' => 'Do nothing if $wgEnableOpenSearchSuggest is false',
9695 );
9796 }
9897
Index: trunk/phase3/includes/DefaultSettings.php
@@ -1976,10 +1976,18 @@
19771977 /**
19781978 * Enable suggestions while typing in search boxes
19791979 * (results are passed around in OpenSearch format)
 1980+ * Requires $wgEnableOpenSearchSuggest = true;
19801981 */
19811982 $wgEnableMWSuggest = false;
19821983
19831984 /**
 1985+ * Enable OpenSearch suggestions requested by MediaWiki. Set this to
 1986+ * false if you've disabled MWSuggest or another suggestion script and
 1987+ * want reduce load caused by cached scripts pulling suggestions.
 1988+ */
 1989+$wgEnableOpenSearchSuggest = true;
 1990+
 1991+/**
19841992 * Template for internal MediaWiki suggestion engine, defaults to API action=opensearch
19851993 *
19861994 * Placeholders: {searchTerms}, {namespaces}, {dbname}

Follow-up revisions

RevisionCommit summaryAuthorDate
r57987Update SimpleSearch docs for r57986catrope18:45, 21 October 2009
r57990Fix for r57986: Notice: Undefined variable: wgEnableOpenSearchSuggest in inc...ialex21:22, 21 October 2009

Status & tagging log