$this->dieUsageMsg( reset( $retval ) );
}
- $this->setWatch( $params['watchlist'], $titleObj );
+ $watch = 'preferences';
+ if ( isset( $params['watchlist'] ) ) {
+ $watch = $params['watchlist'];
+ }
+
+ // Watch pages
+ $this->setWatch( $watch, $titleObj, 'watchrollback' );
$info = array(
'title' => $titleObj->getPrefixedText(),
$p = $this->getModulePrefix();
return array(
- 'title' => "Title of the page you want to delete. Cannot be used together with {$p}pageid",
- 'pageid' => "Page ID of the page you want to delete. Cannot be used together with {$p}title",
+ 'title' => "Title of the page you want to roll back. Cannot be used together with {$p}pageid",
+ 'pageid' => "Page ID of the page you want to roll back. Cannot be used together with {$p}title",
'user' => 'Name of the user whose edits are to be rolled back. If ' .
'set incorrectly, you\'ll get a badtoken error.',
'token' => 'A rollback token previously retrieved through ' .
}
public function getPossibleErrors() {
- return array_merge( parent::getPossibleErrors(), array(
- array( 'invalidtitle', 'title' ),
- array( 'notanarticle' ),
- array( 'nosuchpageid', 'pageid' ),
- array( 'invaliduser', 'user' ),
- ) );
+ return array_merge(
+ parent::getPossibleErrors(),
+ $this->getRequireOnlyOneParameterErrorMessages( array( 'title', 'pageid' ) ),
+ array(
+ array( 'invalidtitle', 'title' ),
+ array( 'notanarticle' ),
+ array( 'nosuchpageid', 'pageid' ),
+ array( 'invaliduser', 'user' ),
+ )
+ );
}
public function needsToken() {