#44134 closed task (blessed) (fixed)
Update to TinyMCE 4.7.13
Reported by: | hometowntrailers | Owned by: | azaozz |
---|---|---|---|
Milestone: | 4.9.8 | Priority: | normal |
Severity: | normal | Version: | 5.1 |
Component: | TinyMCE | Keywords: | needs-testing fixed-major |
Focuses: | Cc: |
Description
WordPress 4.9.6 updated TinyMCE to 4.7.11, but since that ticket was opened two more TinyMCE releases became available.
TinyMCE 4.7.12 and 4.7.13 fixes an additional 20 issues (+/-).
Attachments (1)
Change History (33)
#1
@
6 years ago
- Keywords needs-patch added
- Milestone changed from Awaiting Review to Future Release
- Type changed from defect (bug) to task (blessed)
#2
@
6 years ago
There is a bug report for one of the fixed issues: https://wordpress.org/support/topic/error-with-saving-page-content-tmce-4-7-11-wp-4-9-6-with-avada-theme/.
#4
@
6 years ago
- Milestone changed from Future Release to 4.9.7
And another bug that is fixed in TinyMCE 4.7.13: https://wordpress.org/support/topic/table-bug-with-edge-plugin-needs-update-to-4-7-13/.
Moving to 4.9.7.
This ticket was mentioned in Slack in #core by azaozz. View the logs.
6 years ago
#6
@
6 years ago
I'm also seeing a TypeError: tinymce.ui.Control is undefined
that isn't present in WP 4.9.5.
My TinyMCE plugin JavaScript is https://gist.github.com/danielbachhuber/7994605866299c57e2d9f9bac021f423
#9
@
6 years ago
I get the following issue after updating
https://wordpress.stackexchange.com/questions/304462/wordpress-tinymce-editor-broken-and-nothing-seems-to-fix-it/304467#304467
#11
follow-up:
↓ 12
@
6 years ago
I also get the same issue as @danielbachhuber with tinymce.ui.Control not working. When I debug the tinymce.ui I get only factory functions and nothing else.
#14
@
6 years ago
- Keywords reporter-feedback added
@danielbachhuber @bdanzer29 confirmed that tinymce.ui.Control
is not available before TinyMCE is initialized. This seems to be a change in TinyMCE 4.7.0 and is the same in TinyMCE 4.7.13.
However in my testing the theme seems to always be loaded and initialized first, before the plugins (at least in the default editors in WP, the main editor and the Text widget).
I'm not sure if this will be "fixed" upstream. Also not sure why your plugins are running before TinyMCE and the theme are initialized. Please add any additional info on how to reproduce this, if possible.
#15
@
6 years ago
@azaozz I'm simply registering this GitHub Gist with the following:
public static function filter_mce_external_plugins( $plugins ) { $assets_path = dirname( dirname( __FILE__ ) ) . '/assets'; $assets_url = plugins_url( 'assets', __DIR__ ); $filepath = '/js/tinymce-plugin.js'; $mtime = filemtime( $assets_path . $filepath ); $plugins['tastylinks'] = $assets_url . $filepath . '?v=' . (int) $mtime; return $plugins; }
My TinyMCE plugin closely parallels wplink, so I'm not sure why wplink works and my TinyMCE plugin doesn't.
(function(tinymce){ tinymce.ui.Factory.add( 'WPTastyLinkPreview', tinymce.ui.Control.extend( {
vs.
( function( tinymce ) { tinymce.ui.Factory.add( 'WPLinkPreview', tinymce.ui.Control.extend( {
#16
@
6 years ago
I am registering my script through mce_external_plugins filter.
Edit: Also wanted to add that even if I add a later priority to the filter I still get the same issue.
<?php add_filter('mce_external_plugins', function ($plugin_array) { $plugin_array['lorem'] = Assets::get_plugin_url().Assets::get_asset('js', 'lorem'); $plugin_array['lorem2'] = Assets::get_plugin_url().Assets::get_asset('js', 'lorem2'); return $plugin_array; });
#17
@
6 years ago
Think I found the problem. @danielbachhuber @bdanzer29 can you see if 44134-test.diff fixes it for you? It removes the "old" way of loading external plugins that doesn't seem needed any more.
#18
@
6 years ago
@azaozz When I remove that code it does work for me! Thanks for the help! Do you have any idea when 4.9.7 might be released?
#19
follow-up:
↓ 21
@
6 years ago
- Keywords reporter-feedback removed
@azaozz Yes, 44134-test.diff
fixes the issue for me.
#20
follow-up:
↓ 22
@
6 years ago
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. Made the mistake of posting this to #43862 which is closed (I'm rusty with Trac etiquette).
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.
#21
in reply to:
↑ 19
@
6 years ago
Replying to danielbachhuber:
Created #44330 and patched it there.
#22
in reply to:
↑ 20
;
follow-up:
↓ 23
@
6 years ago
Replying to 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.
Yeah, this is a change (normalization) upstream. All custom events in TinyMCE pass an event object with several properties, the editor instance is one of them. I'm afraid we can't do anything about it.
#23
in reply to:
↑ 22
@
6 years ago
Replying to azaozz:
Replying to 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.
Yeah, this is a change (normalization) upstream. All custom events in TinyMCE pass an event object with several properties, the editor instance is one of them. I'm afraid we can't do anything about it.
I understand, and like I said it's not a daunting task to patch my code. I was just pointing out the issue, since this kinda came out of nowhere in what's usually an auto-update minor release of WP, instead of being in a major release.
#24
@
6 years ago
- Milestone changed from 4.9.7 to 4.9.8
4.9.7 has been released, moving to next milestone.
#25
@
6 years ago
- Summary changed from Update to TinyMCE 4.7.13 to Update to TinyMCE 4.7.13 --- EDIT: or 4.8.0
TinyMCE 4.8.0 has been released today.
Any reason to not upgrade to 4.8.0, rather than 4.7.13?
This ticket was mentioned in Slack in #core by joshuawold. View the logs.
6 years ago
#27
@
6 years ago
- Summary changed from Update to TinyMCE 4.7.13 --- EDIT: or 4.8.0 to Update to TinyMCE 4.7.13
Yeah, TinyMCE 4.8 was released few days ago. Can update straight to it instead of 4.7.x.
#28
@
6 years ago
- Owner set to azaozz
- Resolution set to fixed
- Status changed from new to closed
In 43447:
A list of commits since 4.7.11.
In summary: