* (bug 32497) API now allows changing of protection level using pageid
* (bug 32498) API now allows comparing pages using pageids
* (bug 30975) API import of pages with invalid characters in this wiki leads to Fatal Error
+* (bug 30488) API now allows listing of backlinks/embeddedin/imageusage per pageid
=== Languages updated in 1.20 ===
/**
* @return array
*/
- public function getTitleOrPageIdErrorMessage( ) {
- return $this->getRequireOnlyOneParameterErrorMessages( array( 'title', 'pageid' ) );
+ public function getTitleOrPageIdErrorMessage() {
+ return array_merge(
+ $this->getRequireOnlyOneParameterErrorMessages( array( 'title', 'pageid' ) ),
+ array(
+ array( 'invalidtitle', 'title' ),
+ array( 'nosuchpageid', 'pageid' ),
+ )
+ );
}
/**
return array_merge( parent::getPossibleErrors(),
$this->getTitleOrPageIdErrorMessage(),
array(
- array( 'invalidtitle', 'title' ),
- array( 'nosuchpageid', 'pageid' ),
array( 'notanarticle' ),
array( 'hookaborted', 'error' ),
array( 'delete-toobig', 'limit' ),
return array_merge( parent::getPossibleErrors(),
$this->getTitleOrPageIdErrorMessage(),
array(
- array( 'nosuchpageid', 'pageid' ),
array( 'missingtext' ),
- array( 'invalidtitle', 'title' ),
array( 'createonly-exists' ),
array( 'nocreate-missing' ),
array( 'nosuchrevid', 'undo' ),
return array_merge( parent::getPossibleErrors(),
$this->getTitleOrPageIdErrorMessage(),
array(
- array( 'invalidtitle', 'title' ),
- array( 'nosuchpageid', 'pageid' ),
array( 'toofewexpiries', 'noofexpiries', 'noofprotections' ),
array( 'create-titleexists' ),
array( 'missingtitle-createonly' ),
if ( !is_null( $this->params['continue'] ) ) {
$this->parseContinueParam();
} else {
- if ( $this->params['title'] !== '' ) {
- $title = Title::newFromText( $this->params['title'] );
- if ( !$title ) {
- $this->dieUsageMsg( array( 'invalidtitle', $this->params['title'] ) );
- } else {
- $this->rootTitle = $title;
- }
- }
+ $this->rootTitle = $this->getTitleOrPageId( $this->params );
}
// only image titles are allowed for the root in imageinfo mode
$retval = array(
'title' => array(
ApiBase::PARAM_TYPE => 'string',
- ApiBase::PARAM_REQUIRED => true
+ ),
+ 'pageid' => array(
+ ApiBase::PARAM_TYPE => 'integer',
),
'continue' => null,
'namespace' => array(
public function getParamDescription() {
$retval = array(
- 'title' => 'Title to search',
+ 'title' => "Title to search. Cannot be used together with {$this->bl_code}pageid",
+ 'pageid' => "Pageid to search. Cannot be used together with {$this->bl_code}title",
'continue' => 'When more results are available, use this to continue',
'namespace' => 'The namespace to enumerate',
);
}
public function getPossibleErrors() {
- return array_merge( parent::getPossibleErrors(), array(
- array( 'invalidtitle', 'title' ),
- array( 'code' => 'bad_image_title', 'info' => "The title for {$this->getModuleName()} query must be an image" ),
- array( 'code' => '_badcontinue', 'info' => 'Invalid continue param. You should pass the original value returned by the previous query' ),
- ) );
+ return array_merge( parent::getPossibleErrors(),
+ $this->getTitleOrPageIdErrorMessage(),
+ array(
+ array( 'code' => 'bad_image_title', 'info' => "The title for {$this->getModuleName()} query must be an image" ),
+ array( 'code' => '_badcontinue', 'info' => 'Invalid continue param. You should pass the original value returned by the previous query' ),
+ )
+ );
}
public function getExamples() {
array(
array( 'code' => 'invalidcategory', 'info' => 'The category name you entered is not valid' ),
array( 'code' => 'badcontinue', 'info' => 'Invalid continue param. You should pass the original value returned by the previous query' ),
- array( 'nosuchpageid', 'pageid' ),
)
);
}