• Whenever I try to access /wp-admin/widgets.php, I get “There has been a critical error on this website. Please check your site admin email inbox for instructions.”

    Here’s the error that’s in my debug.log:

    [05-Oct-2022 00:07:32 UTC] PHP Fatal error:  Uncaught TypeError: array_merge(): Argument #7 must be of type array, null given in /wordpress/core/6.0.2/wp-includes/widgets.php:1342
    Stack trace:
    #0 /wordpress/core/6.0.2/wp-includes/widgets.php(1342): array_merge(Array, Array, Array, Array, Array, Array, NULL)
    #1 /wordpress/core/6.0.2/wp-admin/widgets-form.php(121): retrieve_widgets()
    #2 /wordpress/core/6.0.2/wp-admin/widgets.php(34): require('/wordpress/core...')
    #3 {main}
      thrown in /wordpress/core/6.0.2/wp-includes/widgets.php on line 1342
Viewing 4 replies - 1 through 4 (of 4 total)
  • Hello @kgagne ,

    Can you try Classic Widgets plugin and see if this fixed the issue?

    Best Regards!

    Thread Starter kgagne

    (@kgagne)

    Hi, @codersantosh! After installing and activating that plugin, I’m still unable to access the widgets screen. Here’s the error:

    
    
    [23-Oct-2022 16:30:34 UTC] PHP Fatal error:  Uncaught TypeError: array_merge(): Argument #7 must be of type array, null given in /wordpress/core/6.0.3/wp-includes/widgets.php:1342
    Stack trace:
    #0 /wordpress/core/6.0.3/wp-includes/widgets.php(1342): array_merge(Array, Array, Array, Array, Array, Array, NULL)
    #1 /wordpress/core/6.0.3/wp-admin/widgets-form.php(121): retrieve_widgets()
    #2 /wordpress/core/6.0.3/wp-admin/widgets.php(34): require('/wordpress/core...')
    #3 {main}
      thrown in /wordpress/core/6.0.3/wp-includes/widgets.php on line 1342
    [23-Oct-2022 16:30:34 UTC] PHP Deprecated:  strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /wordpress/core/6.0.3/wp-includes/functions.php on line 7037
    [23-Oct-2022 16:30:34 UTC] PHP Deprecated:  str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /wordpress/core/6.0.3/wp-includes/functions.php on line 2164

    Hello @kgagne ,

    It seems like it is from the core widgets.php.
    Are you using PHP version 8 or above?
    For now, I would like to recommend you 7.4.

    I am just guessing about the issue. Can you try it and let me know if this fixed the issue?

    Best Regards!

    Thread Starter kgagne

    (@kgagne)

    I downgraded from PHP 8.1.11 to 7.4.32, and that has indeed resolved the issue. ??

    It’s odd, though — I have other WordPress sites on the same server and hosting plan, also running PHP 8.1.11, and they have no issue accessing the widgets. ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Error accessing widgets’ is closed to new replies.