Last modified: 2013-04-22 16:14:41 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T41158, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 39158 - Submitting or saving edits to a course description prompts a "leave page" warning
Submitting or saving edits to a course description prompts a "leave page" war...
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
EducationProgram (Other open bugs)
unspecified
All All
: High critical (vote)
: ---
Assigned To: Jeroen De Dauw
:
Depends on:
Blocks: 40506
  Show dependency treegraph
 
Reported: 2012-08-08 16:59 UTC by Sage Ross
Modified: 2013-04-22 16:14 UTC (History)
6 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Sage Ross 2012-08-08 16:59:11 UTC
When saving a course description, whether new or edited, pressing the "Submit" button prompts the standard 'data not saved' warning, "This page is asking you to confirm that you want to leave - data you have entered may not be saved." Continuing by pressing "Leave Page" results in the data being saved, however.
Comment 1 Jeroen De Dauw 2012-08-09 18:20:10 UTC
Can't confirm w/o edit rights on test2 or knowing which extension is adding this warning and where. It's probably making some assumptions it should not.
Comment 2 Jeroen De Dauw 2012-08-09 19:08:20 UTC
Confirmed, don't know how to kill this though
Comment 3 Raimond Spekking 2012-08-11 21:08:36 UTC
Similar issue inside UplpoadWizard, reported as bug 38022.
Comment 5 Jarry1250 2012-08-11 22:18:42 UTC
Is this handled at the browser level, perhaps?
Comment 6 Mark Holmquist 2012-09-04 05:07:09 UTC
I looked at this briefly, I needed more info to test...namely, how do I create a course? It's not clear.

Also, the docs are bad. I should probably add a blocker to bug 1 or something.

My instinct is that, like bug 38022, we're setting an onbeforeunload handler and not _un_setting it, or properly checking state inside of it. That could be bad. But I don't know where that's happening.

Anyway, let me know if I can help further with this, else I'm out.
Comment 7 Sage Ross 2012-09-04 15:11:03 UTC
@Mark I've given you the "Education program admin" right on test2.wikipedia.org; you should now be able to create a course from https://test2.wikipedia.org/wiki/Special:Courses
Comment 8 Mark Holmquist 2012-09-04 16:15:53 UTC
This is caused by https://www.mediawiki.org/wiki/Extension:Vector

Every time an edit page is loaded (or maybe every time *any* page is loaded, the Vector code doesn't appear to actually check for an edit page specifically), it loads the JS that loads in an onbeforeunload event.

This preference can be turned off in "My preferences -> Editing -> Warn me when I leave an edit page with unsaved changes". It's not intuitive, though.

There doesn't appear to be a way to disallow a module on the PHP side, so our only recourse may be to totally remove the onbeforeunload event before submit. As you may imagine, this isn't ideal because A) it loads code we don't use and B) it's adding special treatment where there needn't be any.

Thoughts? Ideas?
Comment 9 Sage Ross 2012-09-04 16:21:29 UTC
I think we want this JS to work, but it should only give the warning when the user leaves the page *without* saving their edits.

Is there a way to modify this extension so that it treats the save/submit action the same way as an edit to a normal page?
Comment 10 Mark Holmquist 2012-09-04 16:31:49 UTC
It looks like there's a check for some form elements and their values, so I'll see if that makes a difference.
Comment 11 Mark Holmquist 2012-09-04 17:17:15 UTC
https://gerrit.wikimedia.org/r/22584
Comment 12 Sage Ross 2012-09-21 18:02:33 UTC
I noticed that the warning doesn't show up unless you use an edit summary. Probably irrelevant once the above fix deploys.
Comment 13 Jeroen De Dauw 2012-09-28 19:42:10 UTC
Removed the event handler with https://gerrit.wikimedia.org/r/#/c/25697/

Might not be ideal, but the alternative seems to remove the incorrect assumptions from Vector, which would take a lot more time and block deployment.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links