The web team would like to simplify the code for menu generation in MediaWiki core. To make this easier we would like to reduce the number of hooks that can modify menus to one single hook: SkinTemplateNavigation::Universal.
Background
Every time the SkinTemplateNavigation::SpecialPage and SkinTemplateNavigation hooks are run we also run the SkinTemplateNavigation::Universal hook. The latter is always run based on the current page. We could just run the latter and get rid of 2 needless hooks.
Proposal:
Having 3 hooks doing pretty much the same thing seems gratutious. I would suggest standardizing on SkinTemplateNavigation::Universal and for the hooks themselves to do the required checks they need. I am however open to keeping all three after hearing from the current extensions using these hooks (tagged) and benefits they see in having three of them.
The SkinTemplateNavigation hook is deprecated in favor of SkinTemplateNavigation::Universal . It's up to callers to check whether the title exists if they care.
The SkinTemplateNavigation::SpecialPage is deprecated in favor of SkinTemplateNavigation::Universal. Callers must use $skin->getTitle() to check whether the page is a special page
TODO
- Update Extension:CentralNotice to use SkinTemplateNavigation::Universal instead of SkinTemplateNavigation::SpecialPage
- Update Extension:VisualEditor to use SkinTemplateNavigation::Universal instead of SkinTemplateNavigation::SpecialPage and SkinTemplateNavigation::Universal instead of SkinTemplateNavigation
- Update Extension:Translate to use SkinTemplateNavigation::Universal instead of SkinTemplateNavigation::SpecialPage
- Update Extension:GrowthExperiments to use SkinTemplateNavigation::Universal instead of SkinTemplateNavigation
- Update Extension:LiquidThreads to use SkinTemplateNavigation::Universal instead of SkinTemplateNavigation
- Update Extension:MassMessage to use SkinTemplateNavigation::Universal instead of SkinTemplateNavigation
- Update Extension:Wikilove to use SkinTemplateNavigation::Universal instead of SkinTemplateNavigation
- SkinTemplateNavigation::SpecialPage in core is marked as deprecated
- SkinTemplateNavigation in core is marked as deprecated
QA
- Confirm https://codesearch.wmcloud.org/deployed/?q=SkinTemplateNavigation%3A%3ASpecialPage&i=nope&files=&excludeFiles=&repos= returns no results other than MediaWiki core
- Confirm https://codesearch.wmcloud.org/deployed/?q=SkinTemplateNavigation%22%3A&i=nope&files=&excludeFiles=&repos= returns no results other than MediaWiki core
Sign off steps
- Removal of this code impacts 3rd parties, however for now we are only concerned with fixing deployed Wikimedia code. Removing code will be created in a separate ticket.
https://codesearch.wmcloud.org/search/?q=SkinTemplateNavigation%3A%3ASpecialPage&i=nope&files=&excludeFiles=&repos=
https://codesearch.wmcloud.org/search/?q=SkinTemplateNavigation%22%3A&i=nope&files=&excludeFiles=&repos=
Fixed
Extensions/skins that are fixed are listed here and have been untagged.
- Vector
- FileExporter
- QuizGame
- PictureGame
- BlueSpice
- NSFileRepo
- FlaggedRevs
- AdvancedMeta
- TimedMediaHandler
- Newsletter
- TinyMCE
- ProofreadPage
- Update Extension:EntitySchema to use SkinTemplateNavigation::Universal instead of SkinTemplateNavigation https://gerrit.wikimedia.org/r/803880