}
/**
- * Do standard deferred updates after page view
+ * Do standard deferred updates after page view (existing or missing page)
* @param User $user The relevant user
* @param int $oldid The revision id being viewed. If not given or 0, latest revision is assumed.
*/
return $status->getErrorsArray();
}
+ // raise error, when the edit is an edit without a new version
+ if ( empty( $status->value['revision'] ) ) {
+ $resultDetails = array( 'current' => $current );
+ return array( array( 'alreadyrolled',
+ htmlspecialchars( $this->mTitle->getPrefixedText() ),
+ htmlspecialchars( $fromP ),
+ htmlspecialchars( $current->getUserText() )
+ ) );
+ }
+
$set = array();
if ( $bot && $guser->isAllowed( 'markbotedits' ) ) {
// Mark all reverted edits as bot
);
}
- if ( !empty( $status->value['revision'] ) ) {
- $revId = $status->value['revision']->getId();
- } else {
- $revId = false;
- }
+ $revId = $status->value['revision']->getId();
wfRunHooks( 'ArticleRollbackComplete', array( $this, $guser, $target, $current ) );