Last modified: 2014-06-30 19:40:32 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T54609, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 52609 - VisualEditor: When getting TemplateData, VE automatically adds "Template:" even if another namespace is provided
VisualEditor: When getting TemplateData, VE automatically adds "Template:" ev...
Status: RESOLVED FIXED
Product: VisualEditor
Classification: Unclassified
Editing Tools (Other open bugs)
unspecified
All All
: Normal minor
: VE-deploy-2014-07-03
Assigned To: Alex Monk
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-07 11:43 UTC by Kunal Mehta (Legoktm)
Modified: 2014-06-30 19:40 UTC (History)
6 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Kunal Mehta (Legoktm) 2013-08-07 11:43:20 UTC
If you want to add a "template" that is not in the template namespace, for example: "User:UBX"; VE will make an API request like: "GET https://en.wikipedia.org/w/api.php?format=json&action=templatedata&titles=Template%3AUser%3AUBX".

It should automatically detect that "User:" is a valid namespace, and not add the "Template:" prefix.
Comment 1 Alex Monk 2014-06-19 23:44:58 UTC
It looks like we can just pass the title to mw.Title.newFromText with mw.config.get( 'wgNamespaceIds' ).template as the (default) namespace.
Comment 2 Alex Monk 2014-06-20 00:07:02 UTC
(Okay, it's not as simple as I was hoping)
Comment 3 Gerrit Notification Bot 2014-06-20 00:25:13 UTC
Change 140875 had a related patch set uploaded by Alex Monk:
Handle transcluding templates outside of the template namespace properly

https://gerrit.wikimedia.org/r/140875
Comment 4 Alex Monk 2014-06-20 00:27:17 UTC
This was also hiding another problem (templates outside of the Template namespace ended up prefixed with ':', breaking them). This patch should fix that too (and hopefully not break any other link suggesting things).
Comment 5 Matthew Flaschen 2014-06-26 22:50:29 UTC
The commit says the purpose of the colon is "to create a link to something that would normally be included as a File/Category".

That's true, but it also plays a role in transclusion.  It's used to transclude things in the main namespace.

E.g. on English Wikipedia {{Main Page}} transcludes https://en.wikipedia.org/wiki/Template:Main_Page , whereas {{:Main Page}} transcludes https://en.wikipedia.org/wiki/Main_Page

For other namespaces (e.g. {{Wikipedia:Community Portal}} / {{:Wikipedia:Community Portal}} ), it works either way.

Full demo: https://en.wikipedia.org/w/index.php?title=User:Superm401/Sandbox&oldid=614564227

This may be handled somewhere (e.g. Parsoid), but it needs to be tested.
Comment 6 Roan Kattouw 2014-06-26 23:20:33 UTC
What Matt pointed out is handled correctly except for main namespace titles (e.g. :Foo), where the input widget trips over itself and you always end up with Template:Foo.
Comment 7 Gerrit Notification Bot 2014-06-30 19:39:09 UTC
Change 140875 merged by jenkins-bot:
Handle transcluding templates outside of the template namespace properly

https://gerrit.wikimedia.org/r/140875

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links