From d0c41d1dfc2afc02c0d7b9a2a2908ad8d838ba94 Mon Sep 17 00:00:00 2001 From: jdlrobson Date: Wed, 28 Jul 2021 11:20:07 -0700 Subject: [PATCH] Run Vector's SkinTemplateNavigation hook last Depends-On: Iec99be92378dc1a43f39428caffc03e1f594a927 Bug: T287533 Change-Id: I7d840d047627108a0a921ea52d5cb4bd06f36ab5 --- includes/Hooks.php | 3 +++ includes/SkinVector.php | 9 +++++++++ skin.json | 3 +-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/includes/Hooks.php b/includes/Hooks.php index 9a8059a..0d93a38 100644 --- a/includes/Hooks.php +++ b/includes/Hooks.php @@ -231,6 +231,9 @@ class Hooks { /** * 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 * @param SkinTemplate $sk diff --git a/includes/SkinVector.php b/includes/SkinVector.php index 84d3b6c..166d1d0 100644 --- a/includes/SkinVector.php +++ b/includes/SkinVector.php @@ -24,6 +24,7 @@ use MediaWiki\MediaWikiServices; use Vector\Constants; +use Vector\Hooks; 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 */ diff --git a/skin.json b/skin.json index bbf709b..9f3b8c0 100644 --- a/skin.json +++ b/skin.json @@ -12,7 +12,7 @@ "license-name": "GPL-2.0-or-later", "type": "skin", "requires": { - "MediaWiki": ">= 1.36.0" + "MediaWiki": ">= 1.37.0" }, "ValidSkinNames": { "vector": { @@ -75,7 +75,6 @@ "SkinPageReadyConfig": "Vector\\Hooks::onSkinPageReadyConfig", "GetPreferences": "Vector\\Hooks::onGetPreferences", "PreferencesFormPreSave": "Vector\\Hooks::onPreferencesFormPreSave", - "SkinTemplateNavigation::Universal": "Vector\\Hooks::onSkinTemplateNavigation", "LocalUserCreated": "Vector\\Hooks::onLocalUserCreated", "OutputPageBodyAttributes": "Vector\\Hooks::onOutputPageBodyAttributes", "MakeGlobalVariablesScript": "Vector\\Hooks::onMakeGlobalVariablesScript"