Page MenuHomePhabricator

Provide URL parameter(s) to always load a wikitext editor
Closed, ResolvedPublic

Description

For some use cases that require wikitext editing (ours is T235753), it’s necessary to be able to link to some URL that will always load some wikitext editor, regardless of user preferences or wiki setup.

Options:

  • action=edit: May load VisualEditor.
  • action=submit: Always loads an old wikitext editor (WikiEditor aka 2010 Wikitext Editor, or default MediaWiki <textarea> aka 2003 Wikitext Editor), even if a new wikitext editor (2017 Wikitext Editor) is available.
  • veaction=editsource: Loads 2017 Wikitext Editor if available, loads no editor at all otherwise.
  • action=edit&veaction=editsource: Currently identical to action=edit, i. e. VisualEditor / 2017 Wikitext Editor ignores the veaction.

Related tasks:

Event Timeline

We should probably make option 4 work (action=edit&veaction=editsource). Task T190765 is a similar problem.

That said, I don't understand why you need this. Could you just link to action=edit and let the user's default editor be used? If the page is unsuitable to be edited using VE, then it should be disabled there in some other way (e.g. using a custom content model, or disabling VE in that namespace, etc.).

We should probably make option 4 work (action=edit&veaction=editsource). Task T190765 is a similar problem.

That said, I don't understand why you need this. Could you just link to action=edit and let the user's default editor be used? If the page is unsuitable to be edited using VE, then it should be disabled there in some other way (e.g. using a custom content model, or disabling VE in that namespace, etc.).

It sucks because there seems to be no way of temporarily using the 2017 editor akin to veaction=edit. I want to continue using WikiEditor most of the time, but also the 2017 editor some of the time. Currently this seems impossible without going to Preferences, finding the option, checking it, saving, and turning it off again once you're done—which is quite time-consuming and frustrating.

Change #1066816 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/extensions/VisualEditor@master] Allow &veaction=editsource to load 2017WTE regardless of user prefs

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

I wanted to test a change affecting the new wikitext mode today (T373152) and I finally got fed up with toggling my preferences. :)

It's a small code change, but it affects lots of places. Everything seems to work as expected though. My test plan was:

  • &veaction=editsource loads the new wikitext editor regardless of preferences
  • &action=edit&veaction=editsource also loads the new wikitext editor (veaction=editsource takes precedence over action=edit)
  • &action=submit&veaction=editsource loads the old wikitext editor (action=submit takes precedence over veaction=editsource)
  • Edit mode switching within the editor works
  • &veaction=editsource still works if the user disabled the visual editor in preferences (but currently it does not allow switching to visual mode – this could be changed but seems unimportant)
  • Mobile editor opens its wikitext mode with &veaction=editsource

Change #1066816 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Allow &veaction=editsource to load 2017WTE regardless of user prefs

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

Cool, thanks! (Regarding the mention of T235753 in the task description, I think in the meantime that task changed enough that we don’t need a follow-up to use the new URL parameter there – it looks like we rephrased the interface message from “in the wikitext” to “using the article editor”, so if it ends up opening VE, that’s probably fine.)

This is somewhat old news but it saves so much of developers' time I think it still deserves publicity. Something like:

⚒️ You may now temporarily use the 2017 wikitext editor, even if it's not enabled in your preferences, by adding veaction=editsource to the URL.