Legoktm has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/209489

Change subject: LocalRenameUserJob: Don't try to construct the old user object 
twice
......................................................................

LocalRenameUserJob: Don't try to construct the old user object twice

movePages() would fatal on invalid usernames, so just pass the already
constructed User object to it.

Change-Id: Idf969e77579067cf385f0ef4222343b8ba288fb2
(cherry picked from commit 525899f3baa770178590fd398980581ab5986b9e)
---
M includes/LocalRenameJob/LocalRenameUserJob.php
1 file changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/89/209489/1

diff --git a/includes/LocalRenameJob/LocalRenameUserJob.php 
b/includes/LocalRenameJob/LocalRenameUserJob.php
index fea5825..3961532 100644
--- a/includes/LocalRenameJob/LocalRenameUserJob.php
+++ b/includes/LocalRenameJob/LocalRenameUserJob.php
@@ -72,7 +72,7 @@
                }
 
                if ( $this->params['movepages'] ) {
-                       $this->movePages();
+                       $this->movePages( $oldUser );
                }
 
                if ( $this->params['promotetoglobal'] ) {
@@ -102,11 +102,11 @@
        /**
         * Queue up jobs to move pages
         */
-       public function movePages() {
+       public function movePages( User $oldUser ) {
                $from = $this->params['from'];
                $to = $this->params['to'];
 
-               $fromTitle = User::newFromName( $from )->getUserPage();
+               $fromTitle = $oldUser->getUserPage();
                $toTitle = Title::makeTitleSafe( NS_USER, $to );
                $dbr = wfGetDB( DB_SLAVE );
 

-- 
To view, visit https://gerrit.wikimedia.org/r/209489
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idf969e77579067cf385f0ef4222343b8ba288fb2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: wmf/1.26wmf5
Gerrit-Owner: Legoktm <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to