Critical error on website
Support › Meta Box AIO › Critical error on website
- This topic has 11 replies, 6 voices, and was last updated 2 months, 3 weeks ago by
Bart De Ruyck.
-
AuthorPosts
-
August 25, 2023 at 2:14 AM #43039
ben bruno
ParticipantOk. 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 585August 27, 2023 at 10:29 PM #43055Peter
ModeratorHello,
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.
May 29, 2024 at 7:17 PM #45562wouter
ParticipantHi Ben,
Ever managed to fix this issue? I'm running into the exact same problem after moving items outside of a group.
May 29, 2024 at 8:06 PM #45563ben bruno
ParticipantI 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.
June 1, 2024 at 9:15 PM #45594William Gregorio
ParticipantWhen 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:36For 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.
June 1, 2024 at 9:17 PM #45595William Gregorio
ParticipantHere 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' ] ); } }
January 16, 2025 at 1:36 AM #47421Bart 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.
January 16, 2025 at 11:28 PM #47426Peter
ModeratorHello,
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.
January 17, 2025 at 3:51 PM #47433Bart De Ruyck
ParticipantIf I need to document the issue, let me know. Support can get in touch with me and I'll provide an overview.
January 18, 2025 at 2:02 PM #47447Peter
ModeratorHello Bart,
Please share your site admin account by submitting this contact form https://metabox.io/contact/
I will take a look.January 21, 2025 at 1:47 PM #47485Tan Nguyen
ParticipantHi, I have fixed the issue, you'll get an update shortly.
January 21, 2025 at 2:10 PM #47486Bart De Ruyck
ParticipantThanks! Will this be a general MB update or a specific update to this website?
-
AuthorPosts
- You must be logged in to reply to this topic.