Page MenuHomePhabricator

TemplateData adds empty autovalue
Closed, ResolvedPublicBUG REPORT

Description

List of steps to reproduce (step by step, including full links if applicable):

  • Go to edit a documentation page with a TemplateData block, such as here, and open the TemplateData editor
  • Click on a parameter, go to the autovalue field, and type in some characters.
  • Delete the characters, close out of that parameter, and click Apply

What happens?:
*The TemplateData adds an empty autovalue block.

What should have happened instead?:
The block should not have been added, or TemplateData should not display the block if it is empty.

Event Timeline

Change 742427 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[mediawiki/extensions/TemplateData@master] Fix serialization adding empty autovalue when not needed

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

Change 742427 merged by jenkins-bot:

[mediawiki/extensions/TemplateData@master] Fix serialization adding empty autovalue when not needed

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

awight subscribed.

Failed during demo, the empty autovalue block was still added.

Are you sure? For me it works as intended on the Beta cluster.

Yes, I tried locally and on the beta cluster. Steps to reproduce:

What should happen: no autovalue should be present

What actually happens: the parameter has autovalue: "".

Note that we discussed during sprint review and work on this ticket shouldn't continue until we can discuss with the Product side.

thiemowmde moved this task from Demo to Done on the WMDE-TechWish-XMAS-Sprint-2021-12-15 board.

Thanks for the details! I think this is a misunderstanding. Partly because the described process sounds different from what's written in the task description, as well as because you have been able to verify it before.

I think when you say "apply" you close the TemplateData editor. This persists what was done in the editor and adds "autovalue": "foo" to the page's wikitext. The dialog will never remove an existing field like this, even if it's emptied.

The bug is about an autovalue that is still empty the moment "apply" is clicked. This should not add new, empty "autovalue": "" to the wikitext.

I think when you say "apply" you close the TemplateData editor. This persists what was done in the editor and adds "autovalue": "foo" to the page's wikitext. The dialog will never remove an existing field like this, even if it's emptied.

Are you sure? When I clear an existing "default" value, the property disappears from the JSON.