mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CategoryTree
synced 2024-09-23 10:28:33 +00:00
Remove flag for ParserOutput
The modules are already in the ParserOutput by change I8d2a6d92f45f30495263eea716adb4eeaf7ebfbb. The hack with the flag for the OutputPageParserOutput hook is not needed anymore. Do not deploy this change before the caches has been purged or expired. Bug: T212059 Change-Id: If9427bbf114870ec9747670367915e11750c6525
This commit is contained in:
parent
ea51fc3e92
commit
c1edee1aea
|
@ -106,8 +106,7 @@
|
|||
"SkinAfterPortlet": "default",
|
||||
"SkinBuildSidebar": "default",
|
||||
"ParserFirstCallInit": "default",
|
||||
"OutputPageMakeCategoryLinks": "default",
|
||||
"OutputPageParserOutput": "default"
|
||||
"OutputPageMakeCategoryLinks": "default"
|
||||
},
|
||||
"config": {
|
||||
"CategoryTreeMaxChildren": {
|
||||
|
|
|
@ -29,7 +29,6 @@ use Config;
|
|||
use Html;
|
||||
use IContextSource;
|
||||
use MediaWiki\Hook\OutputPageMakeCategoryLinksHook;
|
||||
use MediaWiki\Hook\OutputPageParserOutputHook;
|
||||
use MediaWiki\Hook\ParserFirstCallInitHook;
|
||||
use MediaWiki\Hook\SkinBuildSidebarHook;
|
||||
use MediaWiki\Hook\SpecialTrackingCategories__generateCatLinkHook;
|
||||
|
@ -38,7 +37,6 @@ use MediaWiki\Linker\LinkTarget;
|
|||
use MediaWiki\Page\Hook\ArticleFromTitleHook;
|
||||
use OutputPage;
|
||||
use Parser;
|
||||
use ParserOutput;
|
||||
use PPFrame;
|
||||
use Sanitizer;
|
||||
use Skin;
|
||||
|
@ -55,14 +53,11 @@ class Hooks implements
|
|||
ArticleFromTitleHook,
|
||||
SpecialTrackingCategories__preprocessHook,
|
||||
SpecialTrackingCategories__generateCatLinkHook,
|
||||
OutputPageParserOutputHook,
|
||||
SkinBuildSidebarHook,
|
||||
ParserFirstCallInitHook,
|
||||
OutputPageMakeCategoryLinksHook
|
||||
{
|
||||
|
||||
private const EXTENSION_DATA_FLAG = 'CategoryTree';
|
||||
|
||||
/** @var CategoryCache */
|
||||
private $categoryCache;
|
||||
|
||||
|
@ -191,8 +186,6 @@ class Hooks implements
|
|||
) {
|
||||
if ( $parser ) {
|
||||
$parserOutput = $parser->getOutput();
|
||||
# flag for use by Hooks::parserOutput
|
||||
$parserOutput->setExtensionData( self::EXTENSION_DATA_FLAG, true );
|
||||
$parserOutput->addModuleStyles( [ 'ext.categoryTree.styles' ] );
|
||||
$parserOutput->addModules( [ 'ext.categoryTree' ] );
|
||||
}
|
||||
|
@ -215,19 +208,6 @@ class Hooks implements
|
|||
return $ct->getTag( $parser, $cat, $hideroot, $attr, $depth, $allowMissing );
|
||||
}
|
||||
|
||||
/**
|
||||
* Hook callback that injects messages and things into the <head> tag,
|
||||
* if needed in the current page.
|
||||
* Does nothing if self::EXTENSION_DATA_FLAG is not set on $parserOutput extension data.
|
||||
* @param OutputPage $outputPage
|
||||
* @param ParserOutput $parserOutput
|
||||
*/
|
||||
public function onOutputPageParserOutput( $outputPage, $parserOutput ): void {
|
||||
if ( $parserOutput->getExtensionData( self::EXTENSION_DATA_FLAG ) ) {
|
||||
CategoryTree::setHeaders( $outputPage );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* ArticleFromTitle hook, override category page handling
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue