Special:WhatLinksHere should canonicalize namespace aliases given in URL
Open, LowestPublic


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


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


This would facilitate the development of utility templates.

Version: unspecified
Severity: enhancement


bzimport set Reference to bz62988.
bzimport added a subscriber: Unknown Object (MLST).
Scott created this task.Mar 23 2014, 8:13 PM

(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.

Scott added a comment.Mar 30 2014, 3:12 AM

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.

Scott added a comment.Mar 30 2014, 3:31 AM

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.

Add Comment