API: (bug 16548) list=search threw invalid errors under certain circumstances
authorRoan Kattouw <catrope@users.mediawiki.org>
Wed, 3 Dec 2008 19:33:57 +0000 (19:33 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Wed, 3 Dec 2008 19:33:57 +0000 (19:33 +0000)
RELEASE-NOTES
includes/api/ApiQuerySearch.php

index 73b645e..3c1d546 100644 (file)
@@ -488,6 +488,7 @@ The following extensions are migrated into MediaWiki 1.14:
   instead of spaces
 * (bug 16516) Made rvsection=T-2 work
 * (bug 16526) Added usprop=canemail to list=users
+* (bug 16548) list=search threw errors with an invalid error code
 
 === Languages updated in 1.14 ===
 
index 639079c..f79e3a0 100644 (file)
@@ -71,14 +71,17 @@ class ApiQuerySearch extends ApiQueryGeneratorBase {
                        // of the way we initially set up the MySQL fulltext-based
                        // search engine with separate title and text fields.
                        // In the future, the default should be for a combined index.
+                       $what = 'title';
                        $matches = $search->searchTitle( $query );
                        
                        // Not all search engines support a separate title search,
                        // for instance the Lucene-based engine we use on Wikipedia.
                        // In this case, fall back to full-text search (which will
                        // include titles in it!)
-                       if( is_null( $matches ) )
+                       if( is_null( $matches ) ) {
+                               $what = 'text';
                                $matches = $search->searchText( $query );
+                       }
                }
                if (is_null($matches))
                        $this->dieUsage("{$what} search is disabled",