Page MenuHomePhabricator

GadgetUsage API results malformed when $wgSpecialGadgetUsageActiveUsers is enabled
Open, Needs TriagePublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

What happens?:
"title": "Spezial:Badtitle/NS1346:gadget-Rechtschreibpruefung"
"title": "Especial:Badtitle/NS777:gadget-CorrectorOrtografico"

What should have happened instead?:
Not entirely sure, on enwiki it returns "title": "Gadget:gadget-Navigation popups". But Gadget: is no valid namespace on enwiki either me thinks. Valid namespace, unused though so arguably still wrong.

On other projects the value for "ns" is the number of active users. On enwiki it's always 2300. See also T120895.

Event Timeline

SD0001 renamed this task from Badtitle in API results for qppage=GadgetUsage to GadgetUsage API results malformed when $wgSpecialGadgetUsageActiveUsers is enabled.Jul 21 2022, 4:52 AM
SD0001 subscribed.

This is occurring on wikis where $wgSpecialGadgetUsageActiveUsers is enabled. Gadget is a recognized namespace on all of these wikis.

Odd that I missed that fact. As Wikimedia wikis don't set $wgGadgetsRepoClass to 'GadgetDefinitionNamespaceRepo' it's unused, but the namespace still exists.

The reason it happens is because the database query needs to store two numbers, the # of enabled users and the # of active users. It abuses the namespace column for the number of active users; given those values are not real namespaces, we end up with Special:BadTitle.

See https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Gadgets/+/refs/heads/master/includes/SpecialGadgetUsage.php#113 and https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Gadgets/+/refs/heads/master/includes/SpecialGadgetUsage.php#195

T354023 explains that, the Gadget: namespace has been removed globally.