Error array_merge
-
WP días ??
Me han pasado un error que le ocurre a un usuario con su plugin.PHP 8.1
Alojado en WordPress.com
El error es el siguiente:Mensaje
PHP Fatal error: Uncaught TypeError: array_merge(): Argument #2 must be of type array, null given in /srv/htdocs/wp-content/plugins/autonomos/core/woocommerce/class-wc-settings-autonomos.php:92 Stack trace: #0 /srv/htdocs/wp-content/plugins/autonomos/core/woocommerce/class-wc-settings-autonomos.php(92): array_merge(Array, NULL, Array) #1 /wordpress/plugins/woocommerce/9.0.0/includes/class-wc-install.php(934): WC_Settings_Autonomos->get_settings('equivalence_sur...') #2 /wordpress/plugins/woocommerce/9.0.0/includes/class-wc-install.php(498): WC_Install::create_options() #3 /wordpress/plugins/woocommerce/9.0.0/includes/class-wc-install.php(452): WC_Install::install_core() #4 /wordpress/plugins/woocommerce/9.0.0/includes/class-wc-install.php(327): WC_Install::install() #5 /wordpress/core/6.5.4/wp-includes/class-wp-hook.php(324): WC_Install::check_version('') #6 /wordpress/core/6.5.4/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #7 /wordpress/core/6.5.4/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #8 /wordpress/core/6.5.4/wp-settings.php(695): do_action('init') #9 /srv/htdocs/wp-config.php(81): require_once('/wordpress/core...') #10 /wordpress/core/6.5.4/wp-load.php(55): require_once('/srv/htdocs/wp-...') #11 /wordpress/core/6.5.4/wp-blog-header.php(13): require_once('/wordpress/core...') #12 /wordpress/core/6.5.4/index.php(17): require('/wordpress/core...') #13 {main} thrown in /srv/htdocs/wp-content/plugins/autonomos/core/woocommerce/class-wc-settings-autonomos.php on line 92
Marca temporal
2024-06-19T19:07:41.000Z
Tipo
plugins
Nombre
autonomos
Archivo
/srv/htdocs/wp-content/plugins/autonomos/core/woocommerce/class-wc-settings-autonomos.php
Línea
92Espero que no te importe pero creo que se pueden a?adir verificaciones en el código para que no devolviera null y de el error al hacer merge.
La solución podría ser estas:- 1)En la function add_tax() se podría devolver return is_array($result) ? $result : array();
- 2)Fusionar el null
$settings2 = apply_filters('autonomos_equivalence_surcharge_settings', $this->add_tax()) ?? array();
$settings = apply_filters('autonomos_equivalence_surcharge_settings', array_merge($settings1, $settings2, $settings3));Gracias de antemano
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- You must be logged in to reply to this topic.