Page MenuHomePhabricator

"Preview" screen assumes changes have been made, even when there were none (doesn't happen on "Edit" screen)
Open, LowestPublic

Description

How to reproduce:

  • click "edit"
  • do not change anything and click "show preview"
  • click on any link leading outside
  • observe the pop-up message: "Leaving this page may lose changes you made"

It should only show the pop-up when actual changes have been made.

Event Timeline

Yurivict raised the priority of this task from to Needs Triage.
Yurivict updated the task description. (Show Details)
Yurivict added a project: MediaWiki-General.
Yurivict subscribed.
Aklapper claimed this task.
Aklapper edited projects, added MediaWiki-Page-editing; removed MediaWiki-General.
Aklapper set Security to None.

That is a feature of your browser, not of MediaWiki. Closing as invalid.

I don't think that the browser is to blame here, because the problem doesn't happen when one clicks out of the page edit screen. It only happens on the preview screen which is a variation of the edit screen.

Yurivict renamed this task from "Preview" screen always assumes that changes have been made, even when there were none to "Preview" screen always assumes that changes have been made, even when there were none (doesn't happen on "Edit" screen).Feb 6 2016, 7:22 PM
Aklapper renamed this task from "Preview" screen always assumes that changes have been made, even when there were none (doesn't happen on "Edit" screen) to "Preview" screen assumes changes have been made, even when there were none (doesn't happen on "Edit" screen).Feb 7 2016, 8:25 PM
Aklapper reopened this task as Open.
Aklapper removed Aklapper as the assignee of this task.
Aklapper triaged this task as Lowest priority.

After leaving the edit page, the javascript of mw.confirmCloseWindow no longer knows what the original text was. It therefore assumes that there have always been changes.

To fix this, you need to introduce a new form field into the submission form; "changed" that is set to true by the JS, when submitting a form, so that this state can be carried across from the edit to the preview page.

Either the "changed" field, or the hash of the original text.