From: Sam Reed Date: Sat, 13 Feb 2010 01:28:26 +0000 (+0000) Subject: dieUsage getPossibleErrors in ApiQuerySearch and ApiQueryRevisions X-Git-Tag: 1.31.0-rc.0~37787 X-Git-Url: http://git.cyclocoop.org/url?a=commitdiff_plain;h=c552a2e2af689720f0ea027b86e1beefcede4567;p=lhc%2Fweb%2Fwiklou.git dieUsage getPossibleErrors in ApiQuerySearch and ApiQueryRevisions --- diff --git a/includes/api/ApiQueryRevisions.php b/includes/api/ApiQueryRevisions.php index 29be3caf11..557d6867f8 100644 --- a/includes/api/ApiQueryRevisions.php +++ b/includes/api/ApiQueryRevisions.php @@ -564,6 +564,13 @@ class ApiQueryRevisions extends ApiQueryBase { public function getPossibleErrors() { return array_merge( parent::getPossibleErrors(), array( array( 'nosuchrevid', 'diffto' ), + array( 'code' => 'revids', 'info' => 'The revids= parameter may not be used with the list options (limit, startid, endid, dirNewer, start, end).' ), + array( 'code' => 'multpages', 'info' => 'titles, pageids or a generator was used to supply multiple pages, but the limit, startid, endid, dirNewer, user, excludeuser, start and end parameters may only be used on a single page.' ), + array( 'code' => 'diffto', 'info' => 'rvdiffto must be set to a non-negative number, "prev", "next" or "cur"' ), + array( 'code' => 'badparams', 'info' => 'start and startid cannot be used together' ), + array( 'code' => 'badparams', 'info' => 'end and endid cannot be used together' ), + array( 'code' => 'badparams', 'info' => 'user and excludeuser cannot be used together' ), + array( 'code' => 'nosuchsection', 'info' => 'There is no section section in rID' ), ) ); } diff --git a/includes/api/ApiQuerySearch.php b/includes/api/ApiQuerySearch.php index 3cef480c11..cb7dc33363 100644 --- a/includes/api/ApiQuerySearch.php +++ b/includes/api/ApiQuerySearch.php @@ -216,6 +216,14 @@ class ApiQuerySearch extends ApiQueryGeneratorBase { public function getDescription() { return 'Perform a full text search'; } + + public function getPossibleErrors() { + return array_merge( parent::getPossibleErrors(), array( + array( 'code' => 'param-search', 'info' => 'empty search string is not allowed' ), + array( 'code' => 'search-text-disabled', 'info' => 'text search is disabled' ), + array( 'code' => 'search-title-disabled', 'info' => 'title search is disabled' ), + ) ); + } protected function getExamples() { return array (