*/
use Wikimedia\Rdbms\IResultWrapper;
-use MediaWiki\Block\BlockRestriction;
+use MediaWiki\MediaWikiServices;
/**
* Query module to enumerate all user blocks
$this->addWhereIf( 'ipb_range_end > ipb_range_start', isset( $show['range'] ) );
}
- if ( !$this->getUser()->isAllowed( 'hideuser' ) ) {
+ if ( !$this->getPermissionManager()->userHasRight( $this->getUser(), 'hideuser' ) ) {
$this->addWhereFld( 'ipb_deleted', 0 );
}
}
}
- $restrictions = BlockRestriction::loadByBlockId( $partialIds );
+ $blockRestrictionStore = MediaWikiServices::getInstance()->getBlockRestrictionStore();
+ $restrictions = $blockRestrictionStore->loadByBlockId( $partialIds );
$data = [];
$keys = [
switch ( $restriction->getType() ) {
case 'page':
$value = [ 'id' => $restriction->getValue() ];
- self::addTitleInfo( $value, $restriction->getTitle() );
+ if ( $restriction->getTitle() ) {
+ self::addTitleInfo( $value, $restriction->getTitle() );
+ }
break;
default:
$value = $restriction->getValue();