Add modules to ParserOutput

This change adds the modules to the ParserOutput object.

The hack with the flag for the OutputPageParserOutput hook is not
needed anymore. But this will removed in the separate change
If9427bbf114870ec9747670367915e11750c6525 to avoid a caching problem.

This change loads the modules on Special:ExpandTemplates if a
<categorytree> is in the content.

Bug: T212059
Change-Id: I8d2a6d92f45f30495263eea716adb4eeaf7ebfbb
This commit is contained in:
Fomafix 2021-09-01 19:19:09 +00:00 committed by Umherirrender
parent 9acd8edf62
commit ed2ec6459b

View file

@ -191,8 +191,11 @@ class Hooks implements
$allowMissing = false
) {
if ( $parser ) {
$parserOutput = $parser->getOutput();
# flag for use by Hooks::parserOutput
$parser->getOutput()->setExtensionData( self::EXTENSION_DATA_FLAG, true );
$parserOutput->setExtensionData( self::EXTENSION_DATA_FLAG, true );
$parserOutput->addModuleStyles( [ 'ext.categoryTree.styles' ] );
$parserOutput->addModules( [ 'ext.categoryTree' ] );
}
$ct = new CategoryTree( $argv );