WordPress.org

Make WordPress Core

#46085 closed defect (bug) (fixed)

TinyMCE Classic Block: fix the edit image modal

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

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 11 months ago.
46085.1.diff (3.0 KB) - added by azaozz 11 months ago.

Download all attachments as: .zip

Change History (7)

@azaozz
11 months ago

#1 @azaozz
11 months 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
11 months ago

  • Keywords has-patch added

@azaozz
11 months ago

#3 @azaozz
11 months 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
11 months ago

  • Keywords commit added

Looks good to me.

#5 @azaozz
11 months 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.