Page MenuHomePhabricator

Forcing visual editing in a non-VE namespace can fail horribly
Closed, DuplicatePublic


Steps to reproduce:

  1. Go to a page in a namespace where VE is not enabled.
  2. Append ?veaction=edit to the URL.

Either nothing should happen or the URL should be treated as explicit opt-in to VE and allow editing in VE without problems.

The actual result depends on your settings:

  1. If you have NWE enabled: You are editing the HTML (not the wikitext) in source mode.
  2. If you never edited before: You are shown a welcoming dialog without any button to close.
  3. If neither of the above: You edit in VE, but with a few bugs. E.g. when reviewing your changes there will be an additional loading bar that doesn't go away.

Neither of the above is really surprising, the URL tries to set visual as defaultMode (relevant code is [[$236|ve.init.Target.prototype.setDefaultMode]]), but that mode isn't available, so you'll either end up with source as mode (case 1), or undefined (which behaves like visual but with the issues 2 or 3).