Page MenuHomePhabricator

Provide an error when pasting invalid JSON as templatedata
Open, Needs TriagePublicFeature

Description

Steps to replicate the issue (include links if applicable):

Try to save this code on mobile

<templatedata>
{
	"params": {
             "1": {
			"required": false,
			"type": "string",
			"description": "Nazwa przycisku"
		}, 
    },
	"description": "Szablon dodaje przycisk do dodawania nowej sekcji"
}
</templatedata>

The param has dangling comma wich is syntax error in JSON.

What happens?:

can't save. The page is frozen on a preview page

What should have happened instead?:
There should be some kind of error indicator.

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia): polish Wikipedia

Other information (browser name/version, screenshots, etc.):

I was creating documentation for the template and copy pasted the JSON from docs that had two params.

Event Timeline

Jcubic updated the task description. (Show Details)
Jcubic updated the task description. (Show Details)
Jcubic updated the task description. (Show Details)
Aklapper renamed this task from Mobile breaks when templatedata has syntax error to Provide an error when pasting invalid JSON as templatedata.Sun, Jun 7, 1:29 AM
Aklapper changed the subtype of this task from "Bug Report" to "Feature Request".