Page MenuHomePhabricator

Parser ignores custom MediaWiki templates
Closed, DeclinedPublic

Description

Author: qleah

Description:
Although there are good reasons for defining a standard set of messages which
belong in the MediaWiki namespace, it's disingenious to forbid custom messages
in the parser. Messages and templates are included with the same syntax, so the
distinction between the two is totally invisible to end users. It would be
reasonable to expect any page in the MediaWiki namespace to override a page of
the same name in the Template namespace; it is counterintuitive that the exact
opposite is true, with the exception of standard messages.


Version: 1.3.x
Severity: enhancement

Details

Reference
bz694

Revisions and Commits

Event Timeline

bzimport raised the priority of this task from to Lowest.Nov 21 2014, 6:57 PM
bzimport set Reference to bz694.
bzimport added a subscriber: Unknown Object (MLST).

jeluf wrote:

Sorry, I don't understand this. Can you provide examples of what works and what not,
and how you suppose it to work?

qleah wrote:

Basic patch; is there a better way?

Attached:

qleah wrote:

(In reply to comment #1)

Sorry, I don't understand this. Can you provide examples of what works and

what not,

and how you suppose it to work?

For example, if someone were to create a MediaWiki:Stub, {{stub}} would continue
to find Template:Stub, even if Template:Stub did not exist. It would be natural
for {{stub}} to alias MediaWiki:Stub rather than producing a red link to
Template:Stub.

jeluf wrote:

But {{ }} is for including pages from Template:-namespace, it's not
intuitive if it would start getting the text from MediaWiki:-namespace.

Sorry, but I still don't see the point in this.

qleah wrote:

(In reply to comment #4)

But {{ }} is for including pages from Template:-namespace, it's not
intuitive if it would start getting the text from MediaWiki:-namespace.

Sorry, but I still don't see the point in this.

Brace expansion currently includes messages from the MediaWiki namespace and
templates from the Template namespace.

wmahan_04 wrote:

(In reply to comment #3)

For example, if someone were to create a MediaWiki:Stub, {{stub}} would continue
to find Template:Stub, even if Template:Stub did not exist. It would be natural
for {{stub}} to alias MediaWiki:Stub rather than producing a red link to
Template:Stub.

This is expected behavior; there is a limited and documented number of
"magic words" that are not treated as templates. Allowing the MediaWiki:
namespace to override the Template: namespace is unnecessary, and could
be confusing.

With the patch, what if a vandal creates MediaWiki:Stub? It would override
Template:Stub, even if the template is protected. I think this change
has little practical benefit.

To clarify: the MediaWiki: namespaces exists solely for the purpose of making
the wiki's internal user interface messages editable without digging into the
source code.

People ended up using a side effect to produce customized templates, which was
neat but cluttered the namespace and bogged down performance as the MediaWiki:
messages clogged the actual user interface message cache. We split off the
Template: namespace to make the custom templates more reliable, easier to use,
and not clutter up the MediaWiki: namespace.

"Custom MediaWiki templates" thus have no meaning; all custom templates belong
in the Template: namespace -- in fact the installer will rename your old 1.2-era
MediaWiki: messages into the Template namespace. Note that as far as I know
{{Foobar}} loads only Template:Foobar, not MediaWiki:Foobar.

epriestley changed the task status from Declined to Resolved by committing Unknown Object (Diffusion Commit).Mar 4 2015, 8:20 AM
epriestley added a commit: Unknown Object (Diffusion Commit).
Aklapper changed the task status from Resolved to Declined.Mar 4 2015, 11:39 AM
Aklapper claimed this task.