Make WordPress Core

Opened 8 years ago

Closed 8 years ago

#46085 closed defect (bug) (fixed)

TinyMCE Classic Block: fix the edit image modal

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

Description

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: ​https://github.com/WordPress/gutenberg/issues/11433. 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 8 years ago.
46085.1.diff​ (3.0 KB ) - added by azaozz 8 years ago.

Download all attachments as: .zip

Change History (7)

@azaozz
8 years ago

#1 @azaozz
8 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
8 years ago

  • Keywords has-patch added

@azaozz
8 years ago

#3 @azaozz
8 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
8 years ago

  • Keywords commit added

Looks good to me.

#5 @azaozz
8 years ago

  • Owner set to azaozz
  • Resolution → fixed
  • Status new → 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.