Page MenuHomePhabricator

Deprecate manual raw TemplateData JSON source editing
Open, Needs TriagePublic

Description

Is there anything that can be done by editing TemplateData JSON as text that cannot be done by editing it in the TemplateData editing form?

The only such thing I can think of is introducing invalid JSON, but that's a bad thing.

If there is nothing else that can be achieved by raw JSON editing then it be deprecated, and editing TemplateData should eventually be possible only through the form. This should make it more structured and less prone to errors.

This should probably go along with something like T56140: Move TemplateData to its own JSON-content namespace and associate with Template-namespace, or to its own TemplateData content model and revision slot.

Event Timeline

Amire80 created this task.Oct 16 2018, 9:14 AM
Restricted Application added a project: VisualEditor. · View Herald TranscriptOct 16 2018, 9:14 AM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Mvolz added a subscriber: Mvolz.Oct 16 2018, 10:33 AM

For one, it's not possible to add maps in the GUI at all. It's only
possible in manual. The maps param is used by citoid and other third party
gadgets like prove it and some wikidata ones. Supporting it would be good
but a little more complicated. Basically you need the full fledged GUI JSON
editor for it because it can have a more arbitrary structure compared to
other params.

Also we need a fall back method for editing that doesn't require
JavaScript, so I don't see how it's possible to get rid of it entirely?

It's also useful for copying over large chunks of template data for
templates that have very similar td. I've done quite a lot of this sort of
copying myself, it's much faster than using the GUI.

There is a long standing bug that allows people save invalid JSON
unfortunately and this does really need to be fixed. The PHP json
interpretor allows duplicate keys and trailing commas.

Amire80 renamed this task from Dperecate manual raw TemplateData JSON source editing to Deprecate manual raw TemplateData JSON source editing.Oct 16 2018, 10:44 AM

For one, it's not possible to add maps in the GUI at all. It's only
possible in manual. The maps param is used by citoid and other third party
gadgets like prove it and some wikidata ones. Supporting it would be good
but a little more complicated. Basically you need the full fledged GUI JSON
editor for it because it can have a more arbitrary structure compared to
other params.

Heh, I wasn't even aware of this. Can you perhaps report the lack of the possibility to do this as a task?

It's also useful for copying over large chunks of template data for
templates that have very similar td. I've done quite a lot of this sort of
copying myself, it's much faster than using the GUI.

Hmm... OK, but this also makes me think why is this needed in the first place. Were these similar templates in the same wiki? Were these functionally similar templates in different wikis?

Could this, at least in theory, be resolved with a more generically designed template, or with a cross-wiki global template? (The latter don't exist at the moment, but may exist at some point in the future.)

For one, it's not possible to add maps in the GUI at all. It's only
possible in manual. The maps param is used by citoid and other third party
gadgets like prove it and some wikidata ones. Supporting it would be good
but a little more complicated. Basically you need the full fledged GUI JSON
editor for it because it can have a more arbitrary structure compared to
other params.

Heh, I wasn't even aware of this. Can you perhaps report the lack of the possibility to do this as a task?

T208305

It's also useful for copying over large chunks of template data for
templates that have very similar td. I've done quite a lot of this sort of
copying myself, it's much faster than using the GUI.

Hmm... OK, but this also makes me think why is this needed in the first place. Were these similar templates in the same wiki? Were these functionally similar templates in different wikis?

Could this, at least in theory, be resolved with a more generically designed template, or with a cross-wiki global template? (The latter don't exist at the moment, but may exist at some point in the future.)

Cross wiki global templates are potentially worse because one way to do that is to have a local copy of the template data for each wiki that's translated into that wiki's language :). I'm not sure the problem of how to internationalise template data has been solved?

A lot of my copying was indeed copying to other languages, but a lot of it was also within language. For instance, the citation templates are all quite similar with just a few changes here and there. There are actually limitations to the flexibility of maps that sometimes require different template data for the SAME template too, although luckily we've been able to make do with existing templates... for the most part.

JTannerWMF moved this task from To Triage to Freezer on the VisualEditor board.Jul 2 2019, 4:28 PM
JTannerWMF added a subscriber: JTannerWMF.

The Editing-team is unable to prioritize this work at this time.