Replace usage of deprecated PageProps::getInstance()

Bug: T289544
Change-Id: I1a5dc0d81063d666cbbea5be6457f97b9cf4e4fc
This commit is contained in:
Alexander Vorwerk 2021-09-26 14:12:19 +02:00
parent cf0a9594af
commit 062d099f2c

View file

@ -240,6 +240,8 @@ class TemplateDataHooks {
public static function onParserFetchTemplateData( array $tplTitles, array &$tplData ): void {
$tplData = [];
$pageProps = MediaWikiServices::getInstance()->getPageProps();
// This inefficient implementation is currently tuned for
// Parsoid's use case where it requests info for exactly one title.
// For a real batch use case, this code will need an overhaul.
@ -274,7 +276,7 @@ class TemplateDataHooks {
// It is also expected that such race conditions resolve themselves
// after a few seconds so the old "try again later" should cover this.
$pageId = $title->getArticleID();
$props = PageProps::getInstance()->getProperties( $title, 'templatedata' );
$props = $pageProps->getProperties( $title, 'templatedata' );
if ( !isset( $props[$pageId] ) ) {
// No templatedata
$tplData[$tplTitle] = (object)[ "notemplatedata" => true ];