Page MenuHomePhabricator

VE should not assume that duplicated arguments to parser functions can be removed
Open, MediumPublic

Description

I was encouraged to file this at https://www.mediawiki.org/w/index.php?title=Topic:Uncadir1bpkjnnbz&topic_showPostId=v6e6trz47cdcxs54&fromnotif=1#flow-post-v6e6trz47cdcxs54

Unlike templates, duplicate named arguments to parser functions do not mask each other. This is particular important to some extensions like (third party) DPL, but also can happen with some core parser funcs.

Steps to reproduce (A bit of a contrived example. It is much less contrived if using Extension:DynamicPageList_(Third_Party)):

  • Add {{gender:Bawolff|user = male|user = female|user = neutral|random third arg=5}} to a page. Note how the result is user = male [Since my user pref is set to male on enwiki currently]
  • Edit page with VE
  • Edit the template with VE, change random third arg to a new value
  • Save page

Expected behaviour:

  • VE would change the third argument, but leave the rest alone, since this is a parser function, so these aren't really named arguments but numbered arguments
  • The template dialog box would show all of these args

Actual behaviour:

At the very least, parser funcs using hashes should be recognized as not normal templates.

Event Timeline

Bawolff created this task.Sep 1 2019, 1:05 AM
Restricted Application added subscribers: Liuxinyu970226, Aklapper. · View Herald TranscriptSep 1 2019, 1:05 AM
Bawolff updated the task description. (Show Details)Sep 1 2019, 1:07 AM
Bawolff updated the task description. (Show Details)Sep 1 2019, 6:35 AM
ppelberg moved this task from To Triage to External and Administrivia on the VisualEditor board.
ppelberg added a subscriber: ppelberg.

Thank you for taking the time to report this as thoroughly and clearly as you have, @Bawolff.

This seems to be a Parsoid-related issue. For now, we're going to hand this task over them to investigate.

LGoto moved this task from Needs Triage to Backlog on the Parsoid board.Feb 15 2020, 12:05 AM
LGoto triaged this task as Medium priority.May 1 2020, 4:18 PM
LGoto moved this task from Backlog to Needs Investigation on the Parsoid board.
cscott added a subscriber: cscott.May 1 2020, 4:19 PM

Probably a VE bug, I believe Parsoid output can correctly represent the duplicated argument, but we'll check it out.

LGoto assigned this task to cscott.May 8 2020, 4:14 PM