Merge "Show a tip at the end of the installer to prompt about extensions"
[lhc/web/wiklou.git] / includes / api / ApiQuerySearch.php
index cfd08a8..0349830 100644 (file)
@@ -93,6 +93,8 @@ class ApiQuerySearch extends ApiQueryGeneratorBase {
                }
                if ( is_null( $matches ) ) {
                        $this->dieUsage( "{$what} search is disabled", "search-{$what}-disabled" );
+               } elseif ( $matches instanceof Status && !$matches->isGood() ) {
+                       $this->dieUsage( $matches->getWikiText(), 'search-error' );
                }
 
                $apiResult = $this->getResult();
@@ -168,7 +170,7 @@ class ApiQuerySearch extends ApiQueryGeneratorBase {
                                        }
                                }
                                if ( isset( $prop['hasrelated'] ) && $result->hasRelated() ) {
-                                       $vals['hasrelated'] = "";
+                                       $vals['hasrelated'] = '';
                                }
 
                                // Add item to results and see whether it fits
@@ -345,6 +347,7 @@ class ApiQuerySearch extends ApiQueryGeneratorBase {
                return array_merge( parent::getPossibleErrors(), array(
                        array( 'code' => 'search-text-disabled', 'info' => 'text search is disabled' ),
                        array( 'code' => 'search-title-disabled', 'info' => 'title search is disabled' ),
+                       array( 'code' => 'search-error', 'info' => 'search error has occurred' ),
                ) );
        }
 
@@ -359,8 +362,4 @@ class ApiQuerySearch extends ApiQueryGeneratorBase {
        public function getHelpUrls() {
                return 'https://www.mediawiki.org/wiki/API:Search';
        }
-
-       public function getVersion() {
-               return __CLASS__ . ': $Id$';
-       }
 }