Page MenuHomePhabricator

[BUG] Improve the template parameter guessing
Closed, ResolvedPublic3 Estimated Story Points

Description

Reported by @TheDJ on the project talk page:

When you try inserting the template "Infobox officeholder", you'll note that the parser trips over interpreting the parameter names due to parserfunctions. It results in fields names like: "minority{{#if:{{{minorityleader2"

image.png (1,394×1,088 px, 146 KB)

The regex that we use to guess parameters should be tweaked to adjust to this use case.

This ticket could probably use more technical fleshing out. From a product standpoint, the aim of this ticket is to weed out as many bad guesses from the list as possible.

Event Timeline

Niharika triaged this task as Medium priority.
aezell set the point value for this task to 3.Sep 5 2018, 11:30 PM
aezell moved this task from Needs Discussion to Up Next (June 3-21) on the Community-Tech board.

One thing we can do is increase the parameter-finding to avoid {{{#, because that's never the start of a valid parameter name.

I think that catches the errors reported here (this was with this template wasn't it?) but there are constructs like this that don't work:

{{{party{{#if:{{{party_election||}}}|_election||}}|}}}

It doesn't find party, but I think that's acceptable isn't it? There are always going to be ways to make things that won't be guessable. (Also, why does this have two pipes after party_election?).

Change 459886 had a related patch set uploaded (by Samwilson; owner: Samwilson):
[mediawiki/extensions/TemplateData@master] Prevent leading hash from starting param names when guessing

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

Change 459886 merged by jenkins-bot:
[mediawiki/extensions/TemplateData@master] Prevent leading hash from starting param names when guessing

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

This will be testable on testwikis when train resumes next week.

Niharika moved this task from QA to Q2 2018-19 on the Community-Tech-Sprint board.

Seems like the problems with Infobox officeholder (what is that??) are resolved. We can tackle others when we find them.