Page MenuHomePhabricator

FR breaks EditWarning from Extension:Vector
Closed, ResolvedPublic

Description

Steps to reproduce:

  1. Log in as an user with editor-rights.
  2. Enable EditWarning ("Warn me when I leave an edit page with unsaved changes" in the editing-tab in your preferences).
  3. Edit a page in a flagged namespace.
  4. Leave without saving.

Expected result: A warning should pop up, asking whether you really want to leave without saving.
Actual result: Nothing happens, you just leave the page.

Since it works for non-editors and with pages that can't be flagged this is a bug in FR, probably the beforeunload handler is overridden.


Version: unspecified
Severity: normal

Details

Reference
bz33164

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 12:05 AM
bzimport set Reference to bz33164.
bzimport added a subscriber: Unknown Object (MLST).

The only unload bind is:
// Flag users as "no longer reviewing" on navigate-away
$( window ).bind( 'beforeunload', function( e ) {
if ( FlaggedRevsReview.isUserReviewing == 1 ) {

		FlaggedRevsReview.deadvertiseReviewing();

}
} );

This should support multiple bindings (using jQuery).

Actually, editWarning does:
window.onbeforeunload = fallbackWindowOnBeforeUnload;

Maybe it should use bind(). jQuery probably overrides handlers done the old way to replace it with it's own handler that triggers all the bind()ed functions.