Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#46085 closed defect (bug) (fixed)

TinyMCE Classic Block: fix the edit image modal

Reported by: azaozz's profile azaozz Owned by: azaozz's profile azaozz
Milestone: 5.1 Priority: normal
Severity: normal Version: 5.0
Component: TinyMCE Keywords: has-patch commit
Focuses: Cc:


Editing an image in the Classic Block often fails. The cause is similar to other failures when using modals in the Classic Block TinyMCE instance: a reference to a DOM node is lost after opening the modal.

This was reported first in Gutenberg: Better to track it here as it is a bug in an old custom WP plugin for TinyMCE.

Attachments (2)

46085.diff (3.3 KB) - added by azaozz 5 years ago.
46085.1.diff (3.0 KB) - added by azaozz 5 years ago.

Download all attachments as: .zip

Change History (7)

5 years ago

#1 @azaozz
5 years ago

In 46085.diff:

  • Add a data-* attribute to the selected image before opening the Edit Image modal, then use it to select the image node before applying changes.
  • Limit the caption wrapper width when editing in the Classic BLock to the editor width. This is passed from the media modal but is wrong in the Block Editor as it comes from the old $content_width global.
  • Some minor cleanup.

#2 @azaozz
5 years ago

  • Keywords has-patch added

5 years ago

#3 @azaozz
5 years ago

In 46085.1.diff: do not change the caption (shortcode) width when editing in the Classic Block instance. Fix the visual regression with CSS.

#4 @iseulde
5 years ago

  • Keywords commit added

Looks good to me.

#5 @azaozz
5 years ago

  • Owner set to azaozz
  • Resolution set to fixed
  • Status changed from new to closed

In 44695:

TinyMCE Classic Block: fix the Edit Image modal to work as in the Classic Editor.

Fixes #46085.

Note: See TracTickets for help on using tickets.