Page MenuHomePhabricator

Rename onPageTabs and add minimal testing
Closed, ResolvedPublic

Description

Currently this hook function doesn't follow the naming convention of being named after the hook that it's being registered to.

This function also contains a little bit of logic and a few user facing features:

  • Disabling the edit page tab on pages that have an entity content model
  • Disabling the viewsource tab on pages that have an entity content model
  • Adding a restore tab if:
    • The user is able to edit the page
    • AND The page is viewing an old revision
    • OR the page is partway through the restore flow
    • AND the revision hasn't been deleted

This is pretty complex and it seems only the edit tab being hidden is covered by an old ruby browser test (edit_tab.feature)

We should at least add a check to make sure that we don't mangle the link list on items that aren't pages with an entity content model. Testing more than this is hard and probably requires refactoring some of this hook into a standalone class.

Event Timeline

Change 689018 had a related patch set uploaded (by Tarrow; author: Tarrow):

[mediawiki/extensions/Wikibase@master] Rename SkinTemplateNavigationHook and add simple test

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

Change 689018 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Rename SkinTemplateNavigationHook and add simple test

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