Merge "Call WikiPage::doViewUpdates also on missing article page view"
[lhc/web/wiklou.git] / includes / WikiPage.php
index aed3b96..3de0475 100644 (file)
@@ -2991,6 +2991,16 @@ class WikiPage implements Page, IDBAccessObject {
                        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
@@ -3012,11 +3022,7 @@ class WikiPage implements Page, IDBAccessObject {
                        );
                }
 
-               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 ) );