Page MenuHomePhabricator

Deprecate SkinTemplateNavigation::SpecialPage and SkinTemplateNavigation hooks in favor of SkinTemplateNavigation::Universal
Closed, ResolvedPublic

Assigned To
Authored By
Jdlrobson
Jun 12 2020, 9:35 PM
Referenced Files
None
Tokens
"Like" token, awarded by Jdlrobson.

Description

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

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

Details

ProjectBranchLines +/-Subject
mediawiki/coremaster+20 -1
mediawiki/extensions/PageFormsmaster+1 -1
mediawiki/extensions/Translatemaster+11 -5
mediawiki/extensions/CentralNoticemaster+2 -2
mediawiki/extensions/Cargomaster+1 -1
mediawiki/extensions/WikiLovemaster+1 -1
mediawiki/extensions/VisualEditormaster+5 -3
mediawiki/extensions/GrowthExperimentsmaster+7 -6
mediawiki/extensions/LiquidThreadsmaster+1 -1
mediawiki/extensions/VisualEditormaster+5 -3
mediawiki/extensions/EntitySchemamaster+2 -2
mediawiki/extensions/ProofreadPagemaster+3 -3
mediawiki/extensions/Newslettermaster+2 -2
mediawiki/extensions/BlueSpicePageAssignmentsmaster+5 -5
mediawiki/extensions/BlueSpicePageAssignmentsREL1_35+5 -5
mediawiki/extensions/TimedMediaHandlermaster+1 -1
mediawiki/extensions/AdvancedMetamaster+9 -9
mediawiki/extensions/AdvancedMetaREL1_35+9 -9
mediawiki/extensions/FlaggedRevsREL1_35+2 -2
mediawiki/extensions/BlueSpiceRemindermaster+5 -5
mediawiki/extensions/BlueSpiceExpirymaster+6 -13
mediawiki/extensions/FlaggedRevsmaster+2 -2
mediawiki/extensions/NSFileRepoREL1_35+2 -2
mediawiki/extensions/NSFileRepomaster+2 -2
mediawiki/extensions/BlueSpiceReadersmaster+8 -5
mediawiki/extensions/BlueSpiceInsertCategorymaster+7 -6
mediawiki/extensions/BlueSpiceBookshelfmaster+5 -5
mediawiki/extensions/BlueSpiceReadersREL1_35+8 -5
mediawiki/extensions/BlueSpiceExpiryREL1_35+6 -13
mediawiki/extensions/BlueSpiceInsertCategoryREL1_35+7 -6
mediawiki/extensions/BlueSpiceBookshelfREL1_35+5 -5
mediawiki/extensions/BlueSpiceReminderREL1_35+5 -5
mediawiki/skins/Vectormaster+5 -2
mediawiki/extensions/FileExportermaster+62 -45
mediawiki/extensions/QuizGamemaster+6 -4
mediawiki/extensions/PictureGamemaster+3 -3
Show related patches Customize query in gerrit

Related Objects

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

Change 714139 had a related patch set uploaded (by Inductiveload; author: Inductiveload):

[mediawiki/extensions/ProofreadPage@master] Use the SkinTemplateNavigation::Universal hook

https://gerrit.wikimedia.org/r/714139

Change 714139 merged by jenkins-bot:

[mediawiki/extensions/ProofreadPage@master] Use the SkinTemplateNavigation::Universal hook

https://gerrit.wikimedia.org/r/714139

Jdlrobson renamed this task from Eventually deprecate SkinTemplateNavigation::SpecialPage and SkinTemplateNavigation hooks in favor of SkinTemplateNavigation::Universal to Deprecate SkinTemplateNavigation::SpecialPage and SkinTemplateNavigation hooks in favor of SkinTemplateNavigation::Universal .May 24 2022, 10:14 PM
Jdlrobson raised the priority of this task from Low to Medium.
Jdlrobson updated the task description. (Show Details)

Change 799000 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/extensions/VisualEditor@master] Use SkinTemplateNavigation::Universal

https://gerrit.wikimedia.org/r/799000

Jdlrobson added a subscriber: Esanders.

@Esanders - requesting editing team review on https://gerrit.wikimedia.org/r/799000. No urgency, but aiming to complete this work during the 1.39 release. Let me know if you have any concerns.

Chatted to @Mabualruz today I advised as a starting point that he focus on SkinTemplateNavigation::SpecialPages.

Work on these bullet points and move this task to "blocked on others":

  • 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
  • SkinTemplateNavigation::SpecialPage in core is marked as deprecated - add Depends-On in commit message to all 3 patches above.

@Nikerabbit, @AndyRussG , @Esanders as a heads up we'll need support from you over the next 2 weeks.

I've reached out to identify helpers for Wikilove, EntitySchema, GrowthExperiments,MassMessage and LiquidThreads.

Change 803880 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/EntitySchema@master] Use SkinTemplateNavigation::Universal instead of SkinTemplateNavigation

https://gerrit.wikimedia.org/r/803880

Change 803880 merged by jenkins-bot:

[mediawiki/extensions/EntitySchema@master] Use SkinTemplateNavigation::Universal instead of SkinTemplateNavigation

https://gerrit.wikimedia.org/r/803880

Change 807568 had a related patch set uploaded (by Mabualruz; author: Mabualruz):

[mediawiki/core@master] Deprecate SkinTemplateNavigation::SpecialPage and SkinTemplateNavigation hooks in favor of SkinTemplateNavigation::Universal

https://gerrit.wikimedia.org/r/807568

Change 807570 had a related patch set uploaded (by Mabualruz; author: Mabualruz):

[mediawiki/extensions/Cargo@master] Deprecate SkinTemplateNavigation::SpecialPage and SkinTemplateNavigation hooks in favor of SkinTemplateNavigation::Universal

https://gerrit.wikimedia.org/r/807570

Change 807571 had a related patch set uploaded (by Mabualruz; author: Mabualruz):

[mediawiki/extensions/CentralNotice@master] Deprecate SkinTemplateNavigation::SpecialPage and SkinTemplateNavigation hooks in favor of SkinTemplateNavigation::Universal

https://gerrit.wikimedia.org/r/807571

Change 807572 had a related patch set uploaded (by Mabualruz; author: Mabualruz):

[mediawiki/extensions/GrowthExperiments@master] Deprecate SkinTemplateNavigation::SpecialPage and SkinTemplateNavigation hooks in favor of SkinTemplateNavigation::Universal

https://gerrit.wikimedia.org/r/807572

Change 807573 had a related patch set uploaded (by Mabualruz; author: Mabualruz):

[mediawiki/extensions/LiquidThreads@master] Deprecate SkinTemplateNavigation::SpecialPage and SkinTemplateNavigation hooks in favor of SkinTemplateNavigation::Universal

https://gerrit.wikimedia.org/r/807573

Change 807574 had a related patch set uploaded (by Mabualruz; author: Mabualruz):

[mediawiki/extensions/MassMessage@master] Deprecate SkinTemplateNavigation::SpecialPage and SkinTemplateNavigation hooks in favor of SkinTemplateNavigation::Universal

https://gerrit.wikimedia.org/r/807574

Change 807575 had a related patch set uploaded (by Mabualruz; author: Mabualruz):

[mediawiki/extensions/Translate@master] Deprecate SkinTemplateNavigation::SpecialPage and SkinTemplateNavigation hooks in favor of SkinTemplateNavigation::Universal

https://gerrit.wikimedia.org/r/807575

Change 807577 had a related patch set uploaded (by Mabualruz; author: Mabualruz):

[mediawiki/extensions/WikiLove@master] Deprecate SkinTemplateNavigation::SpecialPage and SkinTemplateNavigation hooks in favor of SkinTemplateNavigation::Universal

https://gerrit.wikimedia.org/r/807577

Change 807578 had a related patch set uploaded (by Mabualruz; author: Mabualruz):

[mediawiki/extensions/VisualEditor@master] Deprecate SkinTemplateNavigation::SpecialPage and SkinTemplateNavigation hooks in favor of SkinTemplateNavigation::Universal

https://gerrit.wikimedia.org/r/807578

Change 807578 abandoned by Mabualruz:

[mediawiki/extensions/VisualEditor@master] Deprecate SkinTemplateNavigation::SpecialPage and SkinTemplateNavigation hooks in favor of SkinTemplateNavigation::Universal

Reason:

https://gerrit.wikimedia.org/r/807578

Jdlrobson added a subscriber: Mabualruz.

Change 807573 merged by jenkins-bot:

[mediawiki/extensions/LiquidThreads@master] Deprecate SkinTemplateNavigation::SpecialPage and SkinTemplateNavigation hooks in favor of SkinTemplateNavigation::Universal

https://gerrit.wikimedia.org/r/807573

Change 807572 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] Deprecate SkinTemplateNavigation::SpecialPage and SkinTemplateNavigation hooks in favor of SkinTemplateNavigation::Universal

https://gerrit.wikimedia.org/r/807572

Change 799000 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Use SkinTemplateNavigation::Universal

https://gerrit.wikimedia.org/r/799000

Change 807577 merged by jenkins-bot:

[mediawiki/extensions/WikiLove@master] Deprecate SkinTemplateNavigation::SpecialPage and SkinTemplateNavigation hooks in favor of SkinTemplateNavigation::Universal

https://gerrit.wikimedia.org/r/807577

This is blocked on several patches now. I've listed them here with who I think might be able to help us:

If any of you would prefer web team to review these (with a little added risk due to unfamiliarity with the code) please let me know.

Please

Change 807570 merged by jenkins-bot:

[mediawiki/extensions/Cargo@master] Deprecate SkinTemplateNavigation::SpecialPage and SkinTemplateNavigation hooks in favor of SkinTemplateNavigation::Universal

https://gerrit.wikimedia.org/r/807570

Change 807571 merged by jenkins-bot:

[mediawiki/extensions/CentralNotice@master] Deprecate SkinTemplateNavigation::SpecialPage and SkinTemplateNavigation hooks in favor of SkinTemplateNavigation::Universal

https://gerrit.wikimedia.org/r/807571

https://gerrit.wikimedia.org/r/c/mediawiki/core/+/807568 needs more work (isn't working as expected). Would be great to wrap this up tomorrow so it doesn't get carried over to next quarter.
I've reached out to language team for review on https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Translate/+/807575

Change 807575 merged by jenkins-bot:

[mediawiki/extensions/Translate@master] Deprecate SkinTemplateNavigation::SpecialPage and SkinTemplateNavigation hooks in favor of SkinTemplateNavigation::Universal

https://gerrit.wikimedia.org/r/807575

Change 811339 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[operations/mediawiki-config@master] Enable title above tabs everywhere

https://gerrit.wikimedia.org/r/811339

Change 807568 merged by jenkins-bot:

[mediawiki/core@master] Deprecate SkinTemplateNavigation::SpecialPage and SkinTemplateNavigation hooks in favor of SkinTemplateNavigation::Universal

https://gerrit.wikimedia.org/r/807568

Change 811345 had a related patch set uploaded (by Techwizzie; author: Techwizzie):

[mediawiki/extensions/PageForms@master] Deprecate SkinTemplateNavigation hook in favour of SkinTemplateNavigation::Universal

https://gerrit.wikimedia.org/r/811345

Change 811345 merged by jenkins-bot:

[mediawiki/extensions/PageForms@master] Deprecate SkinTemplateNavigation hook in favour of SkinTemplateNavigation::Universal

https://gerrit.wikimedia.org/r/811345

Thanks, everyone for your assistance with this one! It's much appreciated!