Use LinkBatchFactory to create LinkBatch objects

Bug: T325591
Change-Id: I3c529e62e45a38e6752f37b6bf36a1e727511e46
This commit is contained in:
Umherirrender 2022-12-19 21:34:02 +01:00
parent 0a9fcee1b6
commit 8b4ab1fd43

View file

@ -30,7 +30,6 @@ use ExtensionRegistry;
use FormatJson;
use Html;
use IContextSource;
use LinkBatch;
use MediaWiki\Linker\LinkRenderer;
use MediaWiki\MediaWikiServices;
use OutputPage;
@ -463,7 +462,7 @@ class CategoryTree {
) && ExtensionRegistry::getInstance()->isLoaded( 'Translate' );
if ( $suppressTranslations ) {
$lb = new LinkBatch();
$lb = MediaWikiServices::getInstance()->getLinkBatchFactory()->newLinkBatch();
foreach ( $res as $row ) {
$title = Title::newFromText( $row->page_title, $row->page_namespace );
// Page name could have slashes, check the subpage for valid language built-in codes