Problem
I've noticed on Wikitech wiki, when editing a page with a transclusion for Template:Server, then its target in VisualEditor is not a link to the template page (as it normally is), but rather the plain text Server : foo = where foo is the parameter passed. The format of this plain text feels unfamiliar and differs from the wikitext that went into it.
I forked the template to Template:Sandbox as test case, and created a page that calls both templates with the same parameters. Both of them produce the same article HTML, but the Parsoid metadata as shown in VE, is only correct for the "Sandbox" template call and broken for the "Server" template call.
Test case:
- Revision: https://wikitech.wikimedia.org/w/index.php?title=Sandbox&oldid=2431194
- Parsoid: https://wikitech.wikimedia.org/w/api.php?action=visualeditor&format=json&paction=parse&page=Sandbox&uselang=en&editintro=&preload=&preloadparams=&formatversion=2&oldid=2431194
- VE: https://wikitech.wikimedia.org/w/index.php?title=Sandbox&oldid=2431194&veaction=edit
{{Server
| location = eqiad
| decom = yes
}}
{{Sandbox
| location = eqiad
| decom = yes
}}Parsoid HTML:
<table class="infobox vcard" … about="#mwt2" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"Server\\n: location = eqiad\\n","function":"server"},"params":{},"i":0}}]}' id="mwAw">… <table class="infobox vcard" … about="#mwt3" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"Sandbox\\n","href":"./Template:Sandbox"},"params":{"location":{"wt":"eqiad"}},"i":0}}]}' id="mwBA">…
VisualEditor:
Impact
- Template context menu looks confusing.
- Template dialog does not utilize TemplateData documentation to aid the edit session, despite being available via the API (query).
- Template dialog does not link to template documentation page as fallback.
- Template dialog fully disables the ability to edit, add, or remove parameters; not even the manual parameter fallback that would normally be shown as fallback when TemplateData is unavailable.
More information
It took me a while to realize, but I'm fairly certain this is due to a conflict somewhere with the {{SERVER}} magic word. If you reduce the template call to {{Server}} without any parameters, then the parser prefers the magic word over the template call and it all make sense. But, when parameters are present, then the produced HTML and the produced Parsoid metadata disagree with each other.
See also:

