From 64531785a629be6df287ab954e55b1e0a736d65f Mon Sep 17 00:00:00 2001 From: Petr Pchelko Date: Thu, 24 Jun 2021 12:21:49 -0700 Subject: [PATCH] Prepare for CentralIdLookup returning UserIdentity Needed-By: I67bf4f2442269b8aa1002868ede9a71a5ca43a84 Change-Id: I4c2170a25ea8b1cf5410a4648ebec66a3ab253f3 --- maintenance/backfillUnreadWikis.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/maintenance/backfillUnreadWikis.php b/maintenance/backfillUnreadWikis.php index f6ebf96b2..aa3312130 100644 --- a/maintenance/backfillUnreadWikis.php +++ b/maintenance/backfillUnreadWikis.php @@ -1,5 +1,7 @@ getCentralIdLookup(); $rebuild = $this->hasOption( 'rebuild' ); if ( $rebuild ) { @@ -41,10 +43,13 @@ class BackfillUnreadWikis extends Maintenance { $iterator->setCaller( __METHOD__ ); $processed = 0; + $userFactory = MediaWikiServices::getInstance()->getUserFactory(); foreach ( $iterator as $batch ) { foreach ( $batch as $row ) { if ( $rebuild ) { - $user = $lookup->localUserFromCentralId( $row->euw_user, CentralIdLookup::AUDIENCE_RAW ); + $user = $userFactory->newFromUserIdentity( + $lookup->localUserFromCentralId( $row->euw_user, CentralIdLookup::AUDIENCE_RAW ) + ); } else { $user = User::newFromRow( $row ); }