r62412 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r62411‎ | r62412 | r62413 >
Date:01:28, 13 February 2010
Author:reedy
Status:ok
Tags:
Comment:
dieUsage getPossibleErrors in ApiQuerySearch and ApiQueryRevisions
Modified paths:
  • /trunk/phase3/includes/api/ApiQueryRevisions.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQuerySearch.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQuerySearch.php
@@ -216,6 +216,14 @@
217217 public function getDescription() {
218218 return 'Perform a full text search';
219219 }
 220+
 221+ public function getPossibleErrors() {
 222+ return array_merge( parent::getPossibleErrors(), array(
 223+ array( 'code' => 'param-search', 'info' => 'empty search string is not allowed' ),
 224+ array( 'code' => 'search-text-disabled', 'info' => 'text search is disabled' ),
 225+ array( 'code' => 'search-title-disabled', 'info' => 'title search is disabled' ),
 226+ ) );
 227+ }
220228
221229 protected function getExamples() {
222230 return array (
Index: trunk/phase3/includes/api/ApiQueryRevisions.php
@@ -564,6 +564,13 @@
565565 public function getPossibleErrors() {
566566 return array_merge( parent::getPossibleErrors(), array(
567567 array( 'nosuchrevid', 'diffto' ),
 568+ array( 'code' => 'revids', 'info' => 'The revids= parameter may not be used with the list options (limit, startid, endid, dirNewer, start, end).' ),
 569+ 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.' ),
 570+ array( 'code' => 'diffto', 'info' => 'rvdiffto must be set to a non-negative number, "prev", "next" or "cur"' ),
 571+ array( 'code' => 'badparams', 'info' => 'start and startid cannot be used together' ),
 572+ array( 'code' => 'badparams', 'info' => 'end and endid cannot be used together' ),
 573+ array( 'code' => 'badparams', 'info' => 'user and excludeuser cannot be used together' ),
 574+ array( 'code' => 'nosuchsection', 'info' => 'There is no section section in rID' ),
568575 ) );
569576 }
570577

Status & tagging log