Replace use of deprecated ParserOutput::addTrackingCategory()

Depends-On: I697ce188a912e445a6a748121575548e79aabac6
Change-Id: Ie41ad70f1fb5de202355314a96a1243234fb267c
This commit is contained in:
C. Scott Ananian 2021-10-13 14:35:38 -04:00
parent 802c4fbde7
commit 0453ef6021
2 changed files with 7 additions and 3 deletions

View file

@ -10,7 +10,7 @@
"license-name": "GPL-2.0-or-later AND MIT",
"type": "parserhook",
"requires": {
"MediaWiki": ">= 1.36.0"
"MediaWiki": ">= 1.38.0"
},
"APIModules": {
"scribunto-console": "ApiScribuntoConsole"

View file

@ -53,7 +53,9 @@ class ScribuntoContent extends TextContent {
protected function fillParserOutput(
Title $title, $revId, ParserOptions $options, $generateHtml, ParserOutput &$output
) {
$parser = MediaWikiServices::getInstance()->getParser();
$services = MediaWikiServices::getInstance();
$parser = $services->getParser();
$trackingCategories = $services->getTrackingCategories();
$text = $this->getText();
@ -111,7 +113,9 @@ class ScribuntoContent extends TextContent {
$status->getHTML( 'scribunto-error-short', 'scribunto-error-long' )
)
);
$output->addTrackingCategory( 'scribunto-module-with-errors-category', $title );
$trackingCategories->addTrackingCategory(
$output, 'scribunto-module-with-errors-category', $title
);
}
if ( !$generateHtml ) {