Page MenuHomePhabricator

VisualEditor: Transclusion dialog parameter filter should search on both parameter name and parameter label
Closed, ResolvedPublic

Description

Two screenshots showing the search function applied to {{cite book}} on en.wp

A user on the English Wikipedia reports that when entering a template using the transclusion editor, the search for parameters fails when the parameter includes a space:

"when I start typing "Source date" (without quotes, of course) into the search box, something interesting happens when I get to the "d" - the search results say "Unknown parameter". That is, at the point where I've typed "Source d", then - essentially - the search fails; the search software decides that there are no matching entries."

I've tested this with both {{cite web}} and {{cite book}}


Version: unspecified
Severity: enhancement
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=51822

Attached:

VEparametersearch.png (395×517 px, 19 KB)

Details

Reference
bz51670

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 1:49 AM
bzimport set Reference to bz51670.

A user on Wikipedia has determined that the cause is that the data the search function searches on is the internal parameter name, which is invisible to the user, not the visible label. This is very wrong.

"So VE users have learned that the only way, in the Transclusion/Template dialog, to add a parameter is to type the parameter name, then press Enter. But that just changed - now you click the parameter name to select it. That's more obvious - but if, for some reason, having learned the old way, you continue to use it - that's trouble.

Example: Cite web. Let's suppose I want to add the parameter "Month of publication". I type that, hit Enter, and there it is, on the left. Except, not really. VE thinks this is a parameter not on its list - you can tell that because there is no description just above the input box where you enter the value of that parameter. (Compare to entering a value for the parameter "Source title").

Under the hood, here's what happens: VE knows that "Source title" is the label (via TemplateData) for the parameter "title". (Similarly, "URL" is the label for the parameter "url" - and yes, parameters are case sensitive.) But VE doesn't know that "Month of publication" (typed) is the label for the parameter "month". So the template code that VE actually stores is this:

{{Cite web|url = http://example.com|title = Whatever the title is|Month of publication = June}}

That doesn't cause a visible problem on the VE edit page. However, in this case, after saving the page, what is displayed to readers is "Unknown parameter |Month of publication= ignored (help) "

Recommendation: If a person types the name of a parameter and presses Enter, VE should check the typed name against the list of labels in TemplateData, for that template, and if there is a match, handle the new parameter just as if the person had clicked the matching parameter rather than typed it."

Change 82055 had a related patch set uploaded by Trevor Parscal:
Include param label in search index

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

Change 82055 merged by jenkins-bot:
Include param label in search index

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

This is now fixed in master, and will be released to MediaWiki.org on Thursday 5 September, and to Wikipedias on Thursday 12 September. Sorry for the disruption.

Will this allow searching on instring matches of both title and label?

If not, will that be covered by bug 51822 or is a new bug required?