From 062d099f2c6a764b8c8b747f32d1e3c41a541245 Mon Sep 17 00:00:00 2001 From: Alexander Vorwerk Date: Sun, 26 Sep 2021 14:12:19 +0200 Subject: [PATCH] Replace usage of deprecated PageProps::getInstance() Bug: T289544 Change-Id: I1a5dc0d81063d666cbbea5be6457f97b9cf4e4fc --- includes/TemplateDataHooks.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/TemplateDataHooks.php b/includes/TemplateDataHooks.php index ce9db70f..04d69c67 100644 --- a/includes/TemplateDataHooks.php +++ b/includes/TemplateDataHooks.php @@ -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 ];