Steps to replicate the issue
This is how I noticed the issue:
- Open VisualEditor on English Wikipedia
- Type {{ and then tl
- Replace tl with template link
What happens?:
Recall that {{tl}} redirects to {{template link}} on English Wikipedia.
On step 2, we don't get a description for {{tl}}:
On step 3, we do get a description for {{template link}}:
What should have happened instead?:
Both should get descriptions.
Software version (skip for WMF-hosted wikis like Wikipedia):
Other information (browser name/version, screenshots, etc.):
I tried this in Google Chrome Version 115.0.5790.171 (Official Build) (64-bit), though presumably any browser where VisualEditor works would have this problem.
Especially since it looks like, to figure out what to show when you type {{tl, VisualEditor ends up making the following two API calls:
- To generate the completions: https://en.wikipedia.org/w/api.php?action=query&format=json&formatversion=2&generator=prefixsearch&gpssearch=tl&gpsnamespace=10&gpslimit=10 (API Sandbox)
- To fetch data about them: https://en.wikipedia.org/w/api.php?action=templatedata&format=json&formatversion=2&titles=Template%3ATl%7CTemplate%3ATlt%7CTemplate%3ATlxc%7CTemplate%3ATlsc%7CTemplate%3ATl7%7CTemplate%3ATl2%7CTemplate%3ATLR%20signaling%20pathway%7CTemplate%3ATlxc%2Fsandbox%7CTemplate%3ATl2%2Fsandbox&includeMissingTitles=1&lang=en (API Sandbox)
(At least, that's what happened for me.)
Unfortunately, the returned result (with all titles but Template:tl trimmed out, see API Sandbox) is:
{ "batchcomplete": true, "pages": { "66733012": { "title": "Template:Tl", "notemplatedata": true, "params": [] } } }
That certainly explains why VisualEditor isn't showing the description: it didn't receive one.
However, close examination of the API sandbox, or of the API help at https://www.mediawiki.org/w/api.php?action=help&modules=templatedata, reveals the existence of a redirects parameter; if we set this to true (see API Sandbox), we instead get:
{ "batchcomplete": true, "pages": { "1487430": { "title": "Template:Template link", "description": "This template displays a template name as a link surrounded by braces, thus showing how the template name would be used in code. Its primary use is in instruction and documentation.", "params": { "1": { "label": "Template name", "description": "Positional parameter: the template name without the namespace prefix “Template:”, which is added automatically", "type": "wiki-template-name", "required": true, "suggested": false, "deprecated": false, "aliases": [], "autovalue": null, "default": null, "suggestedvalues": [], "example": null } }, "format": "inline", "sets": [], "maps": {} } }, "redirects": [ { "from": "Template:Tl", "to": "Template:Template link" } ] }
This time, we got the TemplateData for the actual template, {{template link}}, along with a list of relevant redirects under the redirects key. That's everything needed to display the actual description (and possibly even the redirect target).
I hope that's helpful.
Here are the screenshots again at full size: