[wp-trac] [WordPress Trac] #44134: Update to TinyMCE 4.7.13

WordPress Trac noreply at wordpress.org
Wed Jun 6 15:04:06 UTC 2018


#44134: Update to TinyMCE 4.7.13
------------------------------+---------------------
 Reporter:  hometowntrailers  |       Owner:  (none)
     Type:  task (blessed)    |      Status:  new
 Priority:  normal            |   Milestone:  4.9.7
Component:  TinyMCE           |     Version:  trunk
 Severity:  normal            |  Resolution:
 Keywords:  needs-patch       |     Focuses:
------------------------------+---------------------

Comment (by dougwollison):

 I came across a breaking change caused by 4.7. It's teeny tiny and can be
 fixed with a single line of code, but it's a break nevertheless.

 Before, when you added a lister to the SetupEditor event, like so:

 {{{
 tinymce.on( 'SetupEditor', function( editor ) {
     // Do stuff with the editor that's been setup
 } );
 }}}

 The callback was passed the editor instance directly. Now though, in 4.7,
 it is instead passed an event object containing the instance:

 {{{
 tinymce.on( 'SetupEditor', function( e ) {
     var editor = e.editor;
     // Do stuff with the editor that's been setup
 } );
 }}}

 Any code that uses the former method will cause errors to be thrown due to
 trying to access properties and methods that don't exist on the event
 object. The most apparent effect to the end user is that the Visual tab in
 the editor appears blank, and you cant switch to/back to Visual view if
 you're on or switch to Text view.

 Thankfully, this is an easy fix, and can be made backwards compatible with
 `var editor = e.editor || e;`

 What's concerning is I didn't spot any mention of the change in TinyMCE's
 change log, beyond a fix to their own Compat3x plugin to account for it.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/44134#comment:20>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list