Merge "Call WikiPage::doViewUpdates also on missing article page view"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Tue, 18 Feb 2014 20:21:37 +0000 (20:21 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 18 Feb 2014 20:21:37 +0000 (20:21 +0000)
1  2 
includes/WikiPage.php

diff --combined includes/WikiPage.php
@@@ -1173,7 -1173,7 +1173,7 @@@ class WikiPage implements Page, IDBAcce
        }
  
        /**
-        * 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 ) );