Page MenuHomePhabricator

Special:WhatLinksHere should canonicalize namespace aliases given in URL
Closed, DeclinedPublicFeature

Description

The namespace parameter for Special:WhatLinksHere only accepts a numeric index:

https://en.wikipedia.org/w/index.php?title=Special%3AWhatLinksHere&target=Example&namespace=4

It should also accept a namespace alias. At present a non-numeric value is ignored:

https://en.wikipedia.org/w/index.php?title=Special%3AWhatLinksHere&target=Example&namespace=Wikipedia

This would facilitate the development of utility templates.


Version: unspecified
Severity: enhancement

Details

Reference
bz62988

Event Timeline

bzimport raised the priority of this task from to Lowest.Nov 22 2014, 2:56 AM
bzimport set Reference to bz62988.
bzimport added a subscriber: Unknown Object (MLST).

(In reply to Scott Martin from comment #0)

This would facilitate the development of utility templates.

Can you provide a specific example? Off-hand I'd think that the namespace ID would be better for use in a template (a programmatic context). The namespace name as a URL parameter requires encoding/quoting if there's anything remotely silly in it; for example, the space in "&namespace=Project talk" would need to be changed to a "_" or "%20" or something, while "&namespace=5" is perfectly fine.

I don't imagine this request is particularly difficult to implement, but I'm still personally unsure the additional code complexity is warranted.

Sure; there's already a {{What links here}} on enwp, which is just a wrapper for [[Special:WhatLinksHere/Page name]]. You can't pass a namespace to it.

An upgraded version would instead generate a link to a fully specified URL. As you note, the parameter name would need to be passed through {{urlencode:}} on the template side.

Okay, all that said, I've just been informed that there is a hacky way to get a namespace index from its alias, by giving a fake page name to {{NAMESPACENUMBER}} - {{NAMESPACENUMBER:Namespace you're interested in:X}}. And I'm going to use that technique right now. So I guess this request is moot and I don't mind it being WONTFIXED on that basis - although I think it would be cool to have a non-hacky way to use a namespace alias directly.

WONTFIXing as bug 35486 makes this unnecessary - Special:WhatLinksHere is becoming embeddable and will take a namespace parameter.

I should note the parameter will still be numeric only.

Oh, right. What I meant by that question on the other bug was specifically would it take a text parameter as suggested in the bug filing.

As the workaround I mentioned above exists, I'll reopen this as a lowest priority enhancement without prejudice against a re-WONTFIX from anyone who knows better.

Aklapper changed the subtype of this task from "Task" to "Feature Request".Feb 4 2022, 11:14 AM
Aklapper removed a subscriber: wikibugs-l-list.
matmarex claimed this task.
matmarex added a subscriber: matmarex.

Probably won't be implemented. I don't think we support anything similar anywhere, and it would add significant complexity (especially since the namespaces are shown in user language rather than content language, so this feature would probably be expected to support both).