• Hi,

    I am attempting to help someone who got a critical error after updating WordPress and using the MH theme.

    As far as I can tell, it has to do with Widgets, probably how that changed with the recent updates.

    This is the error message:

    Fatal error: Uncaught ArgumentCountError: Too few arguments to function WP_Widget::__construct(), 0 passed in /customers/5/0/7/atrejsemedboern.dk/httpd.www/wp-includes/class-wp-widget-factory.php on line 62 and at least 2 expected in /customers/5/0/7/atrejsemedboern.dk/httpd.www/wp-includes/class-wp-widget.php:163 Stack trace: #0 /customers/5/0/7/atrejsemedboern.dk/httpd.www/wp-includes/class-wp-widget-factory.php(62): WP_Widget->__construct() #1 /customers/5/0/7/atrejsemedboern.dk/httpd.www/wp-includes/widgets.php(115): WP_Widget_Factory->register('mh_custom_posts...') #2 /customers/5/0/7/atrejsemedboern.dk/httpd.www/wp-content/themes/mh_magazine_deactivated/includes/mh-widgets.php(7): register_widget('mh_custom_posts...') #3 /customers/5/0/7/atrejsemedboern.dk/httpd.www/wp-includes/class-wp-hook.php(308): register_mh_widgets('') #4 /customers/5/0/7/atrejsemedboern.dk/httpd.www/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters(NULL, Array) #5 /customers/5/0/7/atrejsemedboern.dk/httpd.www/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #6 /customers/5/0/7/atrejsemedboern.dk/httpd.www/wp-includes/widgets.php(1854): do_action('widgets_init') #7 /customers/5/0/7/atrejsemedboern.dk/httpd.www/wp-includes/class-wp-hook.php(308): wp_widgets_init('') #8 /customers/5/0/7/atrejsemedboern.dk/httpd.www/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters(NULL, Array) #9 /customers/5/0/7/atrejsemedboern.dk/httpd.www/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #10 /customers/5/0/7/atrejsemedboern.dk/httpd.www/wp-settings.php(617): do_action('init') #11 /customers/5/0/7/atrejsemedboern.dk/httpd.www/wp-config.php(101): require_once('/customers/5/0/...') #12 /customers/5/0/7/atrejsemedboern.dk/httpd.www/wp-load.php(50): require_once('/customers/5/0/...') #13 /customers/5/0/7/atrejsemedboern.dk/httpd.www/wp-admin/admin.php(34): require_once('/customers/5/0/...') #14 /customers/5/0/7/atrejsemedboern.dk/httpd.www/wp-admin/themes.php(10): require_once('/customers/5/0/...') #15 {main} thrown in /customers/5/0/7/atrejsemedboern.dk/httpd.www/wp-includes/class-wp-widget.php on line 163

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hey @mr_eric_h,

    Can you please let us know which version of PHP is enabled on your server?

    Thread Starter mr_eric_h

    (@mr_eric_h)

    Hey Harish, we’re at 8.0 it seems.

    Hey @mr_eric_h,

    Would it be possible to enable “WP Debug” and then share the “debug.log” error specific to our theme?

    Thread Starter mr_eric_h

    (@mr_eric_h)

    Edit

    • This reply was modified 3 years, 4 months ago by mr_eric_h.
    Thread Starter mr_eric_h

    (@mr_eric_h)

    Seems to be the same that I originally posted:

    thrown in /customers/5/0/7/atrejsemedboern.dk/httpd.www/wp-includes/widgets.php on line 1261
    [03-Jan-2023 18:37:50 UTC] PHP Fatal error: Uncaught ArgumentCountError: array_merge() does not accept unknown named parameters in /customers/5/0/7/atrejsemedboern.dk/httpd.www/wp-includes/widgets.php:1261
    Stack trace: 0 /customers/5/0/7/atrejsemedboern.dk/httpd.www/wp-includes/widgets.php(1261): array_merge(wp_inactive_widgets: Array, sidebar-1: Array, sidebar-2: Array) 1 /customers/5/0/7/atrejsemedboern.dk/httpd.www/wp-includes/widgets.php(1216): retrieve_widgets(true) 2 /customers/5/0/7/atrejsemedboern.dk/httpd.www/wp-includes/class-wp-hook.php(290): _wp_sidebars_changed('MH Magazine') 3 /customers/5/0/7/atrejsemedboern.dk/httpd.www/wp-includes/class-wp-hook.php(312): WP_Hook->apply_filters(NULL, Array) 4 /customers/5/0/7/atrejsemedboern.dk/httpd.www/wp-includes/plugin.php(478): WP_Hook->do_action(Array) 5 /customers/5/0/7/atrejsemedboern.dk/httpd.www/wp-includes/theme.php(2964): do_action('after_switch_th…', 'MH Magazine', Object(WP_Theme)) 6 /customers/5/0/7/atrejsemedboern.dk/httpd.www/wp-includes/class-wp-hook.php(288): check_theme_switched('') 7 /customers/5/0/7/atrejsemedboern.dk/httpd.www/wp-includes/class-wp-hook.php(312): WP_Hook->apply_filters(NULL, Array) 8 /customers/5/0/7/atrejsemedboern.dk/httpd.www/wp-includes/plugin.php(478): WP_Hook->do_action(Array) 9 /customers/5/0/7/atrejsemedboern.dk/httpd.www/wp-settings.php(523): do_action('init') 10 /customers/5/0/7/atrejsemedboern.dk/httpd.www/wp-config.php(101): require_once('/customers/5/0/…') 11 /customers/5/0/7/atrejsemedboern.dk/httpd.www/wp-load.php(37): require_once('/customers/5/0/…') 12 /customers/5/0/7/atrejsemedboern.dk/httpd.www/wp-admin/admin.php(34): require_once('/customers/5/0/…') 13 {main}

    Hey @mr_eric_h,
    Can you please remove the “MH Custom Posts” widget from any sidebar and let me know if that resolves the issue?
    At this point, I’m just trying to pinpoint the issue so I can replicate it.

    Thread Starter mr_eric_h

    (@mr_eric_h)

    Do you know how to do that in PHPMyadmin, because I tried that, but I can’t get to the widgets at all if the theme is active.

    And they don’t seem to be there when the theme isn’t active.

    Hey @mr_eric_h,

    You need to remove the widget from the WordPress backend and not the database.

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Theme broke when updated WordPress’ is closed to new replies.