Page MenuHomePhabricator

Switching from WE to VE and saving, then navigating a different page causes an unsaved changes warning
Closed, ResolvedPublic1 Estimated Story Points

Description

This is related to T49779: Provide a way for the user to switch between VisualEditor and wikitext source editor modes without saving, which reached mw.org a little while ago.

Steps to reproduce:

  1. Open a page in the wikitext editor.
  2. Click the new icon in the toolbar to switch to the visual editor.
  3. (Make some change so that you can save.)
  4. Save the page. (It works.)
  5. Click the history tab.

Result: You get an error message that says your change hasn't been saved.

In Safari 9, the error says: "From “www.mediawiki.org”: "Are you sure you want to leave this page? Leaving this page may cause you to lose any changes you have made. If you are logged in, you can disable this warning in the "Editing" section of your preferences". In Firefox 41, the error says: "This page is asking you to confirm that you want to leave - data you have entered may not be saved."

Expected behavior: No error message, because the page was already saved.

Event Timeline

Another use case:

  1. Open a page in source editing mode
  2. Change something
  3. Switch to VE with "Keep changes"
  4. Click "Switch to source editor" with "Keep changes"

Expected:
The page should navigate to the source editor immediately.

Observed:
I get a message, that my changes hasn't been saved yet and if I really want to navigate away from the site.

Krenair renamed this task from Bi-directional switching causes an error message when you try to navigate to a different page to Switching from WE to VE and saving, then navigating a different page causes an unsaved changes warning.Nov 7 2015, 3:03 AM
Krenair updated the task description. (Show Details)

Change 251684 had a related patch set uploaded (by Alex Monk):
Drop any beforeunload handlers when loading from existing wikitext

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

Change 251684 merged by jenkins-bot:
Drop any beforeunload handlers when loading from existing wikitext

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

Change 251717 had a related patch set uploaded (by Jforrester):
Drop any beforeunload handlers when loading from existing wikitext

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

Change 251717 merged by jenkins-bot:
Drop any beforeunload handlers when loading from existing wikitext

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