Merge "Set the SaveParser logger in RevisionRenderer"
[lhc/web/wiklou.git] / includes / MovePage.php
index ec44b6e..5213fc1 100644 (file)
@@ -523,15 +523,6 @@ class MovePage {
 
                $newpage = WikiPage::factory( $nt );
 
-               # Save a null revision in the page's history notifying of the move
-               $nullRevision = Revision::newNullRevision( $dbw, $oldid, $comment, true, $user );
-               if ( !is_object( $nullRevision ) ) {
-                       throw new MWException( 'No valid null revision produced in ' . __METHOD__ );
-               }
-
-               $nullRevId = $nullRevision->insertOn( $dbw );
-               $logEntry->setAssociatedRevId( $nullRevId );
-
                # Change the name of the target page:
                $dbw->update( 'page',
                        /* SET */ [
@@ -542,6 +533,23 @@ class MovePage {
                        __METHOD__
                );
 
+               # Save a null revision in the page's history notifying of the move
+               $nullRevision = Revision::newNullRevision( $dbw, $oldid, $comment, true, $user );
+               if ( !is_object( $nullRevision ) ) {
+                       throw new MWException( 'Failed to create null revision while moving page ID '
+                               . $oldid . ' to ' . $nt->getPrefixedDBkey() );
+               }
+
+               $nullRevId = $nullRevision->insertOn( $dbw );
+               $logEntry->setAssociatedRevId( $nullRevId );
+
+               /**
+                * T163966
+                * Increment user_editcount during page moves
+                * Moved from SpecialMovepage.php per T195550
+                */
+               $user->incEditCount();
+
                if ( !$redirectContent ) {
                        // Clean up the old title *before* reset article id - T47348
                        WikiPage::onArticleDelete( $this->oldTitle );