Run Vector's SkinTemplateNavigation hook last

Depends-On: Iec99be92378dc1a43f39428caffc03e1f594a927
Bug: T287533
Change-Id: I7d840d047627108a0a921ea52d5cb4bd06f36ab5
This commit is contained in:
jdlrobson 2021-07-28 11:20:07 -07:00 committed by Bernard Wang
parent c000fa9a2a
commit d0c41d1dfc
3 changed files with 13 additions and 2 deletions

View file

@ -231,6 +231,9 @@ class Hooks {
/** /**
* Upgrades Vector's watch action to a watchstar. * Upgrades Vector's watch action to a watchstar.
* This is invoked inside SkinVector, not via skin registration, as skin hooks
* are not guaranteed to run last.
* This can possibly be revised based on the outcome of T287622.
* *
* @see https://www.mediawiki.org/wiki/Manual:Hooks/SkinTemplateNavigation * @see https://www.mediawiki.org/wiki/Manual:Hooks/SkinTemplateNavigation
* @param SkinTemplate $sk * @param SkinTemplate $sk

View file

@ -24,6 +24,7 @@
use MediaWiki\MediaWikiServices; use MediaWiki\MediaWikiServices;
use Vector\Constants; use Vector\Constants;
use Vector\Hooks;
use Vector\VectorServices; use Vector\VectorServices;
/** /**
@ -307,6 +308,14 @@ class SkinVector extends SkinMustache {
]; ];
} }
/**
* @inheritDoc
*/
protected function runOnSkinTemplateNavigationHooks( SkinTemplate $skin, &$content_navigation ) {
parent::runOnSkinTemplateNavigationHooks( $skin, $content_navigation );
Hooks::onSkinTemplateNavigation( $skin, $content_navigation );
}
/** /**
* @inheritDoc * @inheritDoc
*/ */

View file

@ -12,7 +12,7 @@
"license-name": "GPL-2.0-or-later", "license-name": "GPL-2.0-or-later",
"type": "skin", "type": "skin",
"requires": { "requires": {
"MediaWiki": ">= 1.36.0" "MediaWiki": ">= 1.37.0"
}, },
"ValidSkinNames": { "ValidSkinNames": {
"vector": { "vector": {
@ -75,7 +75,6 @@
"SkinPageReadyConfig": "Vector\\Hooks::onSkinPageReadyConfig", "SkinPageReadyConfig": "Vector\\Hooks::onSkinPageReadyConfig",
"GetPreferences": "Vector\\Hooks::onGetPreferences", "GetPreferences": "Vector\\Hooks::onGetPreferences",
"PreferencesFormPreSave": "Vector\\Hooks::onPreferencesFormPreSave", "PreferencesFormPreSave": "Vector\\Hooks::onPreferencesFormPreSave",
"SkinTemplateNavigation::Universal": "Vector\\Hooks::onSkinTemplateNavigation",
"LocalUserCreated": "Vector\\Hooks::onLocalUserCreated", "LocalUserCreated": "Vector\\Hooks::onLocalUserCreated",
"OutputPageBodyAttributes": "Vector\\Hooks::onOutputPageBodyAttributes", "OutputPageBodyAttributes": "Vector\\Hooks::onOutputPageBodyAttributes",
"MakeGlobalVariablesScript": "Vector\\Hooks::onMakeGlobalVariablesScript" "MakeGlobalVariablesScript": "Vector\\Hooks::onMakeGlobalVariablesScript"