WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 17 months ago

Last modified 17 months ago

#18279 closed defect (bug) (worksforme)

Using Featured image: post state is set dirty, even when no changes to content

Reported by: jacobcoens Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.2.1
Component: Post Thumbnails Keywords: has-patch
Focuses: Cc:

Description

Browser: IE

Behavior:
When editing a post and clicking 'Set featured image', a (thickbox) popup opens. When cancelling, the MCE state is dirty, even when no changes to the content have been made.
This is causing the message 'Are you sure you want to navigate away from this page?' to be displayed when navigating to another page.

Cause:
This happens in IE because a bookmark is created to store the caret position.

Fix:
Remember the 'dirty' state of MCE, and re-apply it to the editor after creating the bookmark.

In wp-admin/js/media-upload.dev.js, replace line 62-68 with below:

var ed;

if ( typeof tinyMCE != 'undefined' && tinymce.isIE && ( ed = tinyMCE.activeEditor ) && !ed.isHidden() ) {

var dirty = ed.isDirty();
ed.focus();
ed.windowManager.insertimagebookmark = ed.selection.getBookmark();
ed.isNotDirty = !dirty;

}

Attachments (1)

18279.patch (527 bytes) - added by SergeyBiryukov 3 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 jacobcoens3 years ago

  • Keywords has-patch removed

SergeyBiryukov3 years ago

comment:2 SergeyBiryukov3 years ago

  • Keywords has-patch added

comment:3 ocean9017 months ago

  • Keywords close added

Can we close this ticket in favour of the new media modal?

comment:4 SergeyBiryukov17 months ago

  • Keywords close removed
  • Milestone Awaiting Review deleted
  • Resolution set to worksforme
  • Status changed from new to closed

Could not reproduce the original bug neither in 3.2.1 (reported version) nor in 3.5-beta3.

Version 0, edited 17 months ago by SergeyBiryukov (next)
Note: See TracTickets for help on using tickets.