WordPress.org

Make WordPress Core

Opened 4 months ago

Last modified 2 days ago

#41124 new defect (bug)

TinyMCE popup doesn't works with latest release

Reported by: UmeshSingla Owned by:
Milestone: 4.9.1 Priority: normal
Severity: normal Version: 4.8
Component: TinyMCE Keywords:
Focuses: Cc:

Description

I'm using TinyMCE popup for a custom plugin, with latest WordPress 4.8, it throws a error.
https://monosnap.com/file/3vlSZSNz47BObS8KfSKKvaTOzYH3Yw.png

I dig in deeper, and found out, the changes in
https://core.trac.wordpress.org/changeset/40583
https://build.trac.wordpress.org/changeset/40453/, are causing the issue.

https://build.trac.wordpress.org/browser/trunk/wp-includes/js/tinymce/tiny_mce_popup.js#L56
https://build.trac.wordpress.org/browser/trunk/wp-includes/js/tinymce/utils/mctabs.js#L15

dom and util are loaded directly and not as plugins, and hence when createInstance is called in https://build.trac.wordpress.org/browser/trunk/wp-includes/js/tinymce/plugins/compat3x/plugin.js#L284, tinymce is unable to resolve the Classnames and it throws the above error.

The fix is to revert the path to tinymce.util.Dispatcher and tinymce.dom.DOMUtils

I couldn't locate the use of these at other places in core, so not sure, if that's gonna break something else. But I did test the regular text editor in WordPress and TinyMCE Advance plugin, they both worked fine with the changes.

Attachments (1)

41124.diff (1.1 KB) - added by UmeshSingla 4 months ago.
Updated dom and util path for tinymce

Download all attachments as: .zip

Change History (5)

@UmeshSingla
4 months ago

Updated dom and util path for tinymce

#1 @azaozz
4 months ago

  • Milestone changed from Awaiting Review to 4.9

This was fixed upstream and will be in the next TinyMCE update. Can also add it i the next dot update as it is in an external TinyMCE plugin. See: https://github.com/tinymce/tinymce/commit/5949e57cf91f6d397ccb663f7255f50e743cab24.

However this functionality (tinymce-popup.js) is a left over/compatibility mode for TinyMCE 3.x that was last used in WordPress 3.8. It will be much better to update your plugin to not use such outdated APIs.

Last edited 4 months ago by azaozz (previous) (diff)

This ticket was mentioned in Slack in #core by melchoyce. View the logs.


2 days ago

#4 @melchoyce
2 days ago

  • Milestone changed from 4.9 to 4.9.1
Note: See TracTickets for help on using tickets.