WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 2 years ago

#40360 closed defect (bug) (duplicate)

TinyMCE error when attempting to edit images in the WYSIWYG

Reported by: eclev91 Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.7.3
Component: TinyMCE Keywords: reporter-feedback
Focuses: Cc:

Description

Usually within the WYSIWYG, you can click on an image you've inserted and get the contextual menu to make some edits to it. I'm currently getting a JS error anytime I try to click on an image:

tinymce.min.js:10 Uncaught DOMException: Failed to execute 'setBaseAndExtent' on 'Selection': There is no child at offset 1.
    at B.<anonymous> (https://sternerstuffdesign.com/wp/wp-includes/js/tinymce/tinymce.min.js?ver=4403-20160901:10:7658)
    at t.i [as fire] (https://sternerstuffdesign.com/wp/wp-includes/js/tinymce/tinymce.min.js?ver=4403-20160901:8:14427)
    at B.fire (https://sternerstuffdesign.com/wp/wp-includes/js/tinymce/tinymce.min.js?ver=4403-20160901:8:16322)
    at p.s (https://sternerstuffdesign.com/wp/wp-includes/js/tinymce/tinymce.min.js?ver=4403-20160901:10:15645)
    at e (https://sternerstuffdesign.com/wp/wp-includes/js/tinymce/tinymce.min.js?ver=4403-20160901:2:12478)
    at HTMLHtmlElement.m (https://sternerstuffdesign.com/wp/wp-includes/js/tinymce/tinymce.min.js?ver=4403-20160901:2:12818)

WordPress 4.7.3. I've deactivated all plugins and reverted to a default theme (TwentySeventeen) to no avail.

Change History (8)

#1 @eclev91
2 years ago

Dropped in an .mp4 item with the "Embed Media Player" option, and with that I don't get the error.

#2 @boldwater
2 years ago

I am experiencing the exact same error across multiple versions of wordpress, themes, plugin sets, and servers.

I first noticed it yesterday, and I'm a pretty heavy user.

Chrome 58.0.3029.41 beta (64-bit) on MacOS 10.12.3

#3 @eclev91
2 years ago

I've found that if you click and drag around on the image a little, the menu will usually crop up. For anyone trying to fight through until a patch.

#4 @azaozz
2 years ago

  • Keywords reporter-feedback added

Usually within the WYSIWYG, you can click on an image you've inserted and get the contextual menu to make some edits to it.

Are you talking about the standard browser (right-click) context menu or the TinyMCE plugin that shows a context menu? I tried both of them and they didn't throw any errors.

Or perhaps you are talking about the "floating toolbar" that is shown when selecting an image, where you can align, edit or delete it? This also works properly here, no errors.

Can you also add more info about your browser, try with another browser, try it in "safe/incognito" mode without browser addons, etc.

Last edited 2 years ago by azaozz (previous) (diff)

#5 @boldwater
2 years ago

A single left click on an embedded image in the visual editor should select the image and show the alignment tools and edit icon in a toolbar as well as the resize handles.

What I experience here is that when clicking on an image the cursor indicator moves next to the image and the image is not selected. Console generates the error noted by OP. And as the OP indicated if I click-hold and then wiggle the mouse around on the image a bit the image does become selected.

I have tried in private windows, restarted my computer, disabled all extensions, and forced a cache clear. I manage over a hundred wordpress sites so I checked this behavior on several of them, and the error is the same.

I tried in Safari and the selection works as expected.

It seems specific to Chrome (possibly to Beta) as it was updated on the 31st and the selection function worked last week. I just installed todays Beta release and the issue persists.

#6 @eclev91
2 years ago

Also on Chrome beta. I'll try Firefox and IE/Edge when I'm back to a computer and report back. Might even try Chrome Canary.

#7 @azaozz
2 years ago

Re-testing in Chrome Version 57.0.2987.133 in a stock WordPress 4.7.3 install: Clicking on an image works properly. The "floating" toolbar and "resize handles" are shown, and there aren't any errors in the console.

Maybe something has changed in Chrome beta. If that's the case, could you open a ticket for Chromium. Sounds like a possible regression and I hope it won't make it into the release.

Also, good idea to try to reproduce this in the TinyMCE demo: https://www.tinymce.com/docs/demo/basic-example/ (you won't see the floating toolbar but there should be no errors).

Last edited 2 years ago by azaozz (previous) (diff)

#8 @azaozz
2 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

This is a bug in TinyMCE that is fixed in the latest version.

Duplicate of #40305.

Note: See TracTickets for help on using tickets.