Support » Alpha/Beta/RC » Fatal errors on metaboxes with Classic Editor when WP_DEBUG is true

  • Resolved Claudiu Lodromanean



    I was doing some testing with WooCommerce and the WP 5.0 beta and I noticed an issue. Here’s how to reproduce and what happens:

    1. I tested with the latest 5.0 beta released yesterday, a recent version of WooCommerce (version 3.4+) that adds the ‘”__block_editor_compatible_meta_box” => false’ flag to force the classic editor on Products, Coupons, Orders, etc., and the latest version of the Classic Editor plugin.

    2. When WP_DEBUG is true, navigating to any Product/Order/etc. page causes fatal errors on the metaboxes:
    Fatal error: Uncaught ReflectionException: Function WC_Meta_Box_Product_Images::output() does not exist in /srv/www/woodev/wp-admin/includes/template.php:1100
    Stack trace:
    #0 /srv/www/woodev/wp-admin/includes/template.php(1100): ReflectionFunction->__construct(‘WC_Meta_Box_Pro…’)
    #1 /srv/www/woodev/wp-admin/edit-form-advanced.php(707): do_meta_boxes(Object(WP_Screen), ‘side’, Object(WP_Post))
    #2 /srv/www/woodev/wp-admin/post.php(179): include(‘/srv/www/woodev…’)
    #3 {main} thrown in /srv/www/woodev/wp-admin/includes/template.php on line 1100

    3. When WP_DEBUG is false all the metaboxes render properly.

    The error seems to be coming from the code block in wp-admin/includes/template.php lines 1096-1129 that only gets processed when WP_DEBUG is true and seems to be related to the ReflectionFunction class. As you can see here ( the function “causing the fatal error” definitely exists.

    I’m still investigating the root cause and digging through the new code in WP core and will post back if I discover something, but I thought I’d give a heads-up.


Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Fatal errors on metaboxes with Classic Editor when WP_DEBUG is true’ is closed to new replies.