Skip to content

Commit

Permalink
Keep using UserRightsProxy before 1.41
Browse files Browse the repository at this point in the history
  • Loading branch information
Universal-Omega authored Jan 17, 2024
1 parent 11e480c commit 4e4d0fd
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions includes/ImportDumpRequestManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
use SpecialPage;
use stdClass;
use User;
use UserRightsProxy;
use Wikimedia\Rdbms\DBConnRef;
use Wikimedia\Rdbms\ILBFactory;
use Wikimedia\Rdbms\SelectQueryBuilder;
Expand Down Expand Up @@ -418,9 +419,13 @@ public function getCommand(): string {
*/
public function getUserGroupsFromTarget() {
$userName = $this->getRequester()->getName();
$remoteUser = $this->actorStoreFactory
->getUserIdentityLookup( $this->getTarget() )
->getUserIdentityByName( $userName );
if ( version_compare( MW_VERSION, '1.41', '>=' ) ) {
$remoteUser = $this->actorStoreFactory
->getUserIdentityLookup( $this->getTarget() )
->getUserIdentityByName( $userName );
} else {
$remoteUser = UserRightsProxy::newFromName( $this->getTarget(), $userName );
}

if ( !$remoteUser ) {
return [ $this->messageLocalizer->msg( 'importdump-usergroups-none' )->text() ];
Expand Down

0 comments on commit 4e4d0fd

Please sign in to comment.