WordPress.org

Make WordPress Core

#45311 closed defect (bug) (duplicate)

Block editor incompatible meta boxes are skipped instead of reverting to the classic editor

Reported by: littler.chicken Owned by:
Milestone: Priority: normal
Severity: normal Version: 5.0
Component: Editor Keywords:
Focuses: Cc:

Description

I have a custom meta box for which the __block_editor_compatible_meta_box flag is set to false, as it includes an instance of wp_editor, which did not work with the block editor for a while (although this appears to be resolved).

I'm experiencing different results with the flag set this way:

In trunk (5.1-alpha, which I think is currently the same as 4.9.8), with Gutenberg active, WordPress (correctly) reverts to the classic editor.

In 5.0-beta3-43878 (and yesterday's build), without Gutenberg active, the block editor loads and the meta box is silently skipped altogether.

In 5.0-beta3-43878 with Gutenberg active, the classic editor does attempt to load, but results in a white screen with this error message in the console:

Uncaught TypeError: Cannot read property 'then' of undefined
    at post.php?post=77&action=edit&classic-editor:2024
(anonymous) @ post.php?post=77&action=edit&classic-editor:2024

which appears to be specifically referring to an error in this script:

<script type='text/javascript'>
	window._wpLoadBlockEditor.then( function () {
	wp.data.dispatch( 'core/edit-post' ).setAvailableMetaBoxesPerLocation( {"side": [/*(block editor compatible boxes)*/],"normal": [/*(block editor compatible boxes)*/],"advanced": [/*(block editor compatible boxes)*/]});});
</script>

My understanding of the meta box compatibility flags https://make.wordpress.org/core/2018/11/07/meta-box-compatibility-flags/ is that setting __block_editor_compatible_meta_box to false should force a fallback to the classic editor, even without Gutenberg installed, regardless of whether the __back_compat_meta_box flag is set at all. (Note: setting both to false still results in the block editor loading without the custom metabox showing in the current beta.)
Working locally with WP_DEBUG set to true on both sites and Gutenberg 4.2.0.

Change History (2)

#1 @SergeyBiryukov
23 months ago

  • Milestone changed from Awaiting Review to 5.0

#2 @pento
23 months ago

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

Thank you for the bug report, @littler.chicken! We're still ironing out exactly how this will function behind the scenes, so it hasn't been committed yet.

You can see the current progress in #45217.

Note: See TracTickets for help on using tickets.