Last modified: 2009-11-29 15:17:27 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 T23682, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 21682 - EditWarning script warns about leaving a page that is not changed
EditWarning script warns about leaving a page that is not changed
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
UsabilityInitiative (Other open bugs)
unspecified
All All
: Normal major with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-11-29 14:59 UTC by Nux
Modified: 2009-11-29 15:17 UTC (History)
2 users (show)

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


Attachments

Description Nux 2009-11-29 14:59:22 UTC
Steps:
1. Enable EditWarning script (UsabilityInitiative/EditWarning/EditWarning.js).
2. Enable preview upon first edit.
3. Edit any page.
4. Attempt to close it without any changes.

The problem is that the script checks if the preview element is available, but it should be checking whether the action is "submit". That is:
// Check if the current values of some form elements are the same as
// the original values
if(
	wgAction == 'submit'
	|| $j( '#wpSummary' ).data( 'origtext' ) != $j( '#wpSummary' ).val()
	|| $j( '#wpTextbox1' ).data( 'origtext' ) != $j( '#wpTextbox1' ).val()
) {
...

Rather then currently used:
// Check if the current values of some form elements are the same as
// the original values
if(
	$j( '#wpTextbox1' ).data( 'origtext' ) != $j( '#wpTextbox1' ).val()
	|| $j( '#wpSummary' ).data( 'origtext' ) != $j( '#wpSummary' ).val()
	|| $j( '#wikiPreview' ).is( ':visible' )
) {
...

BTW. The order of checks is intentional - the check of origtext and wpTextbox1 val is potentially the most time (CPU) consuming and therefore the script should rule out other options first.
Comment 1 Roan Kattouw 2009-11-29 15:17:27 UTC
Fixed in r59546.

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


Navigation
Links