Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#46071 closed defect (bug) (fixed)

TinyMCE Classic Block: fix "Advanced Link" 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:

Description (last modified by azaozz)

The "Advanced Link" modal doesn't work reliably in the Classic Block instance. Sometimes it doesn't insert a link, sometimes it inserts it at the beginning of the text instead of the cursor position.

This was reported for Gutenberg some time ago. See and the 6-7 issues closed as duplicates. Opening this ticket here as it is an issue with one of our old custom TinyMCE plugins.

Attachments (1)

46071.diff (5.2 KB) - added by azaozz 5 years ago.

Download all attachments as: .zip

Change History (9)

5 years ago

#1 @azaozz
5 years ago

There are few reasons for these bugs. Most importantly the editor instance is inline and some "utility" functions work a bit differently.

In 46071.diff:

  • Refresh the wpLink modal and wplink editor plugin a bit.
  • Always select the (newly inserted or existing) link node after the modal has been opened. Passing it from the editor plugin breaks as the editor content is reloaded on editor.blur(), and opening the modal and clicking in it triggers that.
  • Remove outdated editor.focus() on opening the modal (was bad for accessibility).

Tested in Firefox, Chrome and Edge on Win10.

#2 @azaozz
5 years ago

  • Keywords has-patch added

#3 @azaozz
5 years ago

  • Description modified (diff)

#4 @iseulde
5 years ago

  • Keywords commit added

Ok, looks good.

#5 @azaozz
5 years ago

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

In 44696:

TinyMCE Classic Block: fix the Advanced Link modal (accessible when clicking on the cogwheel in the inline link modal in a Classic Block).

Fixes #46071.

#6 @ocean90
5 years ago

In 44699:

TinyMCE Classic Block: Remove unused variable.

See #46071.

#7 @noisysocks
5 years ago

#44348 was marked as a duplicate.

#8 @pento
5 years ago

#45678 was marked as a duplicate.

Note: See TracTickets for help on using tickets.