Page MenuHomePhabricator

VisualEditor removes empty paramaters when adding infobox
Closed, ResolvedPublic


This seems like some new problem with VE. Tested in Firefox 86 (current).


  1. Polish Wikipedia, any article.
  2. Type "{{" (template).
  3. "Snookerzysta infobox".
  4. Fill first field/parameter.
  5. Add and ignore warnings.
  6. View changes (don't save please ;-))


Only a filled parameter is present in code. So only one is visible in code preview. Both required parameters and suggested ones are removed by VE (not by user).

Note that the same thing happens on enwiki. Was just easier for me to find a good example on plwiki. On enwiki you can test e.g. with a "Infobox station" template and fill just an "address" field (you will notice that "name" is not present in code).


All parameters that are not removed in VE must be present in code. This includes both required and suggested parameters.
Required parameters must remain unremovable in VE (as they are now).

Event Timeline

matmarex added a subscriber: matmarex.

Removing suggested parameters was an intentional change from T101075. However, this should probably not be done for parameters that are required.

As a reference: Possibility to remove required params was explicitly blocked in T62358.

Change 671269 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/extensions/VisualEditor@master] Never remove empty required parameters

Change 671269 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] Never remove empty required parameters

I filed a new task about better support for parameters that are intentionally empty: T280078. That would allow us to restore the previous behavior, where suggested parameters are always added to the wikitext when inserting the infobox (even when they're not required and they're not filled in).