Demon has uploaded a new change for review.
https://gerrit.wikimedia.org/r/59834
Change subject: Handle search engine returning status objects to the API
......................................................................
Handle search engine returning status objects to the API
This is a followup to I54ab5207, which allowed search backends
to return status objects. We handled it in Special:Search, but
the API was overlooked.
Bug: 47353
Change-Id: Ib7abe8d5bc19d27c472053602c0e43cb1301b078
---
M includes/api/ApiQuerySearch.php
1 file changed, 3 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/34/59834/1
diff --git a/includes/api/ApiQuerySearch.php b/includes/api/ApiQuerySearch.php
index 8618339..ab78ba6 100644
--- a/includes/api/ApiQuerySearch.php
+++ b/includes/api/ApiQuerySearch.php
@@ -93,6 +93,8 @@
}
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();
@@ -345,6 +347,7 @@
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' ),
) );
}
--
To view, visit https://gerrit.wikimedia.org/r/59834
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib7abe8d5bc19d27c472053602c0e43cb1301b078
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Demon <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits