Make WordPress Core

Opened 2 months ago

Last modified 2 months ago

#53644 new defect (bug)

WPeditor not fully initialized in a classic metabox

Reported by: dway Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 5.6
Component: TinyMCE Keywords: needs-testing
Focuses: javascript Cc:


Since WordPress 5.6, a call to wpeditor() in a classic metabox loads partially TinyMCE : the buttons seems to work, Text tab too, but visual edition stay white, without cursor or content (that you can add in the Text tab).

It's really close to #53632 but the only way to get the visual tab working is :

  • edit a post
  • click Text tab of tinyMCE
  • reload page (CTRL-R)
  • and then click on Visual tab

If the visual tab is the one showing first, it stays white.

I've also tried with the Changeset [51407], but the bug remains the same.

You can test it by adding the attached code to your theme or plugin, on a fresh install of WP.

Attachments (3)

test-wpeditor-metabox.php (1.4 KB) - added by dway 2 months ago.
WP-5.5.5-wpeditor.png (25.7 KB) - added by dway 2 months ago.
WP-5.6+-wpeditor.png (22.3 KB) - added by dway 2 months ago.

Download all attachments as: .zip

Change History (6)

#1 @azaozz
2 months ago

  • Keywords reporter-feedback added

Testing with test-wpeditor-metabox.php in trunk and the 5.8 branch (no plugins or only Classic Editor, Twenty Twenty-One theme). Initialization of TinyMCE in the metabox seems to work properly on both the old Edit Post screen (with Classic Editor), and in the block editor.

@dway can you think of anything else that may be affecting this? Possible causes might be that the postbox node is moved in the DOM during or after initialization, or perhaps there is some code that tries to "hold" or repeat the initialization.

#2 @dway
2 months ago

Thx @azaozz for your reply.

I think I've found a clue. Weird one. I was testing locally, on macOS Big Sur with my classic dev stack (apache, php 7.4 and mysql from brew) which works perfectly for tons of other projects I developped, and then, just to be sure, I've tested on my production server (Debian 10), and the wp_editor loads normally...

I was thinking about loading time and file loading order, more slower on the online server than locally. But I've also tested with the bandwith limiter of Firefox dev tools, set on 3G, but, still, the bug is only showing up on local (wordpress-last.localdev).

Not really aware of the initialization process of tinyMCE, but if you can point me to some tests I should do, please let me know (like showing the real order of things to load).

Last edited 2 months ago by dway (previous) (diff)

#3 @desrosj
2 months ago

  • Keywords reporter-feedback removed
Note: See TracTickets for help on using tickets.