Critical error on website

Support Meta Box AIO Critical error on website

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #43039
    ben brunoben bruno
    Participant

    Ok. Here is my first question. I am having troubles in oxygen with a couple of group fields. So I moved items out of the group. When I did, site crashed. And here is my error log.
    If I enable Metabox AIO -- I cannot access custom fields. Any idea how to clear it?

    Specifically, if I enable MB Builder I get There has been a critical error on this website. Please check your site admin email inbox for instructions.

    Learn more about troubleshooting WordPress.

    [24-Aug-2023 18:27:00 UTC] PHP Fatal error: Uncaught TypeError: array_reduce(): Argument #1 ($array) must be of type array, null given in /home/igdev/public_html/wp-content/plugins/oxygen/component-framework/includes/metabox/oxygen-metabox-integration.php:585
    Stack trace:
    #0 /home/igdev/public_html/wp-content/plugins/oxygen/component-framework/includes/metabox/oxygen-metabox-integration.php(585): array_reduce(NULL, Array)
    #1 [internal function]: OxygenMetaBoxIntegration->add_button(Array, Array)
    #2 /home/igdev/public_html/wp-content/plugins/oxygen/component-framework/includes/metabox/oxygen-metabox-integration.php(585): array_reduce(Array, Array)
    #3 [internal function]: OxygenMetaBoxIntegration->add_button(Array, Array)
    #4 /home/igdev/public_html/wp-content/plugins/oxygen/component-framework/includes/metabox/oxygen-metabox-integration.php(108): array_reduce(Array, Array, Array)
    #5 /home/igdev/public_html/wp-includes/class-wp-hook.php(310): OxygenMetaBoxIntegration->init_dynamic_data(Array)
    #6 /home/igdev/public_html/wp-includes/plugin.php(205): WP_Hook->apply_filters(Array, Array)
    #7 /home/igdev/public_html/wp-content/plugins/oxygen/component-framework/includes/oxygen-dynamic-shortcodes.php(18): apply_filters('oxygen_custom_d...', Array)
    #8 /home/igdev/public_html/wp-includes/class-wp-hook.php(310): Oxygen_VSB_Dynamic_Shortcodes->init_custom_dynamic_data(Object(WP))
    #9 /home/igdev/public_html/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters(NULL, Array)
    #10 /home/igdev/public_html/wp-includes/plugin.php(565): WP_Hook->do_action(Array)
    #11 /home/igdev/public_html/wp-includes/class-wp.php(796): do_action_ref_array('wp', Array)
    #12 /home/igdev/public_html/wp-includes/functions.php(1335): WP->main('')
    #13 /home/igdev/public_html/wp-blog-header.php(16): wp()
    #14 /home/igdev/public_html/index.php(17): require('/home/igdev/pub...')
    #15 {main}
    thrown in /home/igdev/public_html/wp-content/plugins/oxygen/component-framework/includes/metabox/oxygen-metabox-integration.php on line 585

    #43055
    PeterPeter
    Moderator

    Hello,

    The error log indicates the issue comes from the plugin Oxygen builder. You can deactivate this plugin and try to edit the field group again.

    #45562
    wouterwouter
    Participant

    Hi Ben,

    Ever managed to fix this issue? I'm running into the exact same problem after moving items outside of a group.

    #45563
    ben brunoben bruno
    Participant

    I did fix it...I ditched metabox and went to ACF. Never looked back. I had more troubles with metabox in the short time I used it then I have ever had with ACF.

    Metabox completely broke my site. And from the beginning, it did nothing but give me trouble.

    #45594
    William GregorioWilliam Gregorio
    Participant

    When using the Meta Box settings page plugin with WordPress, a critical error may occur due to saving fields without specifying values. This can lead to a fatal error when the count() function is called on a null value within the Manager.php file of the plugin. The problem I believe occurs because the code is trying to count something that isn't there, leading to a crash.

    Error frontend: There has been a critical error on this website.
    Learn more about troubleshooting WordPress.

    Error backend: Warning: Undefined array key "fields" in /home/directory/public_html/wp-content/plugins/mb-core/vendor/meta-box/mb-settings-page/src/Customizer/Manager.php on line 36
    Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /home/directory/public_html/wp-content/plugins/mb-core/vendor/meta-box/mb-settings-page/src/Customizer/Manager.php:36

    For temporary purposes, I switched the function to:
    private function change_input_file( &$field ) {
    $field['type'] = ( $field['type'] === 'file' || $field['type'] === 'image' ) ? $field['type'] . '_advanced' : $field['type'];

    if ( 'group' === $field['type'] && isset($field['fields']) && is_array($field['fields']) && count($field['fields']) > 0 ) {
    array_walk( $field['fields'], [ $this, 'change_input_file' ] );
    }
    }

    You will need shell access and wp-cli, this was only because I could not get in at all, nor could I deactivate the plugin within the shell with wp-cli, after you are back in, then just delete the issue within the GUI, insert the original private function back, and your back, hopefully, this can help someone in the future.

    #45595
    William GregorioWilliam Gregorio
    Participant

    Here is the private function within the backticks format

    
    private function change_input_file( &$field ) {
     $field['type'] = ( $field['type'] === 'file' || $field['type'] === 'image' ) ? $field['type'] . '_advanced' : $field['type'];
     if ( 'group' === $field['type'] && isset($field['fields']) && is_array($field['fields']) && 
       count($field['fields']) > 0 ) {
       array_walk( $field['fields'], [ $this, 'change_input_file' ] );
     }
    }
    
    #47421
    Bart De RuyckBart De Ruyck
    Participant

    @William, thank you for posting this here and helping us out.

    Why on earth is this still not fixed in MetaBox? Every single update, the file needs to be modified or overwritten. That's just completely ridiculous.

    #47426
    PeterPeter
    Moderator

    Hello,

    I still cannot reproduce the issue on my demo site to understand what's wrong there. However, I will forward the error message to the development team to check if we can improve something for future updates.

    Thank you.

    #47433
    Bart De RuyckBart De Ruyck
    Participant

    If I need to document the issue, let me know. Support can get in touch with me and I'll provide an overview.

    #47447
    PeterPeter
    Moderator

    Hello Bart,

    Please share your site admin account by submitting this contact form https://metabox.io/contact/
    I will take a look.

    #47485
    Tan NguyenTan Nguyen
    Participant

    Hi, I have fixed the issue, you'll get an update shortly.

    #47486
    Bart De RuyckBart De Ruyck
    Participant

    Thanks! Will this be a general MB update or a specific update to this website?

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.