Page MenuHomePhabricator

VisualEditor doesn't filter out deprecated template parameters
Closed, ResolvedPublic

Description

Minor inconsistency between TemplateWizard and VE: VE shows and allows to use all parameters, even marked as deprecated in TemplateData, TemplateWizard doesn't do this. Ideally, they should have the same behavior, in my opinion, so this should be fixed.

Steps to reproduce:

  1. Go to https://ru.wikipedia.org/wiki/Инкубатор:Песочница
  2. Edit with visual editor and try to insert a template called Iw
  3. Check if nocat and status parameters are available to use
  4. Do the same in TemplateWizard in Russian Wikipedia and see that deprecated parameters are unavailable to insert from the interface.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

@stjn The question here is, is it a good idea to allow people to use deprecated parameters in the template knowing that they will be removed soon?

I’m not sure of semantics of deprecated in TemplateData (AFAIK, there’s no concrete front-facing documentation on how these should be used, so no one on the projects really follows it), but it should at least be consistent across the platforms. If you think that TemplateWizard does a better job here then we need to ask VE team why they aren’t filtering deprecated parameters.

(I personally use deprecated for parameters that aren’t really OK to suggest in articles, but can’t be removed from template’s code since they can be used somewhere else.)

@stjn I found some documentation for deprecated here: https://www.mediawiki.org/wiki/Help:TemplateData

@Deskana Maybe you can provide information on why VE chooses to allow users to insert deprecated params and if TemplateWizard should follow suit? Thanks.

According to the documentation, "This is a status for parameters which should not be used any more." So the best thing to do would be to have VE filter them out, IMO.

kaldari renamed this task from TemplateWizard fails to show deprecated parameters, like VE does to VisualEditor doesn't filter out deprecated template parameters.Nov 16 2018, 6:46 PM
kaldari updated the task description. (Show Details)

Note that VE is aware of deprecated parameters, but all it does is display a little message about it in the help menu:

image.png (516×557 px, 50 KB)

(In English, it says "Field is deprecated.", followed by the message defined in the TemplateData)

So it would probably be an easy change to not suggest display (when they are not already set) deprecated parameters. (Note that we would still allow adding deprecated parameters, as VE's template dialog allows adding any parameter, even if it's not defined in TemplateData.)

Change 478954 had a related patch set uploaded (by Esanders; owner: Esanders):
[mediawiki/extensions/VisualEditor@master] Exclude deprecated params from search list

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

Change 478954 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] Exclude deprecated params from search list

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