Page MenuHomePhabricator

{{SUBPAGENAME}} and {{SUBPAGENAMEE}} don't work on all namespaces
Closed, InvalidPublic

Description

Remove code restricting to namespaces with subpages

Ok, this is a documented 'feature': they only work on namespaces whith subpages enabled. But there's no reason they shouldn't work on the rest as well. SUBPAGENAME has a well-documented behaviour, its use means you want exactly the subpage, else you would be using {{PAGENAME}}
It also causes inconsistencies when moving templates from one wiki to another (eg. bug 15050).

PAtch attached which modifying {{SUBPAGENAME[E]}} behaviour, as well as {{BASEPAGENAME[E]}} to keep consistency. The only use on core and svn extensions of those two title functions is to implement these magic words.


Version: 1.14.x
Severity: enhancement

Attached:

Details

Reference
bz15051

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:19 PM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz15051.
bzimport added a subscriber: Unknown Object (MLST).

ayg wrote:

{{PAGENAME}} means "return full page name unconditionally", {{SUBPAGENAME}} means "return subpage name if this is a subpage, otherwise return full page name". Some expected behavior is not necessarily going to work if the namespace doesn't support subpages. Not sure this is a good idea -- if you're moving pages to a namespace without subpages, you should either rename the (ex-)subpages to something that doesn't use subpage syntax, or enable subpages in the namespace.

It means that only because that's the way it has been coded. The name is {{SUBPAGENAME}} not {{SUBPAGENAMEIFNSALLOWSTHEM}} ;)
Bug 5167 just asks for a magic word to differentiate between page levels.

Either subpages exist in the namespace, or they don't. They need to *not* be broken so pages like [[OS/2]] don't think they're subpages of [[OS]].