[wp-trac] [WordPress Trac] #45311: Block editor incompatible meta boxes are skipped instead of reverting to the classic editor

WordPress Trac noreply at wordpress.org
Thu Nov 8 13:16:21 UTC 2018


#45311: Block editor incompatible meta boxes are skipped instead of reverting to
the classic editor
-----------------------------+-----------------------------
 Reporter:  littler.chicken  |      Owner:  (none)
     Type:  defect (bug)     |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  Editor           |    Version:  5.0
 Severity:  normal           |   Keywords:
  Focuses:                   |
-----------------------------+-----------------------------
 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.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/45311>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list