Page MenuHomePhabricator

Hide unused namespaces in Advanced-Search menu
Open, Needs TriagePublic

Description

On dewp exist unused namespaces where currently are no pages in it (Gadget, Gadget Discussion, Gadget-Definition, Gadget-Definition Discussion and Thema).

As there is nothing to search it would be useful to hide those no content namespaces in the drop-menu of the search form.

The technology to do this exists. There is SiteStats::pagesInNs() in PHP, used for e.g. the {{PAGESINNAMESPACE:…}} ParserFunctions as well as in Scribunto. While none of the existing use cases run this in a loop, doing so should be fine. The results are cached via main WAN cache for 1 hour.

Baseline:

  • Remove namespaces from the array that's send to the client when SiteStats::pagesInNs() returns zero. It's just noise that can't be used for anything anyway.

To be discussed:

  • Is it helpful to see that a namespace exists? If so, is it relevant that this happens in this particular place?

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Wnme updated the task description. (Show Details)

Change 955891 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[mediawiki/extensions/AdvancedSearch@master] [POC] Hide empty namespaces in AdvancedSearch namespace dropdown

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