$name = $titleObj->getPrefixedDBkey();
$model = $contentHandler->getModelID();
- if ( $contentHandler->supportsDirectApiEditing() === false ) {
+
+ if ( $params['undo'] > 0 ) {
+ // allow undo via api
+ } elseif ( $contentHandler->supportsDirectApiEditing() === false ) {
$this->dieUsage(
"Direct editing via API is not supported for content model $model used by $name",
'no-direct-editing'
$this->dieUsageMsg( array( 'nosuchrevid', $params['undoafter'] ) );
}
- if ( $undoRev->getPage() != $pageObj->getID() ) {
- $this->dieUsageMsg( array( 'revwrongpage', $undoRev->getID(),
+ if ( $undoRev->getPage() != $pageObj->getId() ) {
+ $this->dieUsageMsg( array( 'revwrongpage', $undoRev->getId(),
$titleObj->getPrefixedText() ) );
}
- if ( $undoafterRev->getPage() != $pageObj->getID() ) {
- $this->dieUsageMsg( array( 'revwrongpage', $undoafterRev->getID(),
+ if ( $undoafterRev->getPage() != $pageObj->getId() ) {
+ $this->dieUsageMsg( array( 'revwrongpage', $undoafterRev->getId(),
$titleObj->getPrefixedText() ) );
}
// If no summary was given and we only undid one rev,
// use an autosummary
if ( is_null( $params['summary'] ) &&
- $titleObj->getNextRevisionID( $undoafterRev->getID() ) == $params['undo']
+ $titleObj->getNextRevisionID( $undoafterRev->getId() ) == $params['undo']
) {
$params['summary'] = wfMessage( 'undo-summary' )
->params( $params['undo'], $undoRev->getUserText() )->inContentLanguage()->text();