Page MenuHomePhabricator

[BUG] Improve the template parameter guessing
Closed, ResolvedPublic3 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"

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 Normal priority.Sep 5 2018, 8:47 PM
Niharika created this task.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 5 2018, 8:47 PM
Restricted Application added a project: VisualEditor. · View Herald TranscriptSep 5 2018, 11:24 PM
Restricted Application added a project: VisualEditor. · View Herald TranscriptSep 5 2018, 11:25 PM
Restricted Application added a project: VisualEditor. · View Herald TranscriptSep 5 2018, 11:27 PM
aezell set the point value for this task to 3.Sep 5 2018, 11:30 PM
aezell moved this task from To be estimated/discussed to Estimated on the Community-Tech board.
Samwilson moved this task from Ready to In Development on the Community-Tech-Sprint 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 closed this task as Resolved.Oct 12 2018, 11:15 PM
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.

Restricted Application added a project: User-Ryasmeen. · View Herald TranscriptOct 12 2018, 11:16 PM