Make WordPress Core

Changes between Version 1 and Version 2 of Ticket #56127, comment 2


Ignore:
Timestamp:
10/14/2022 04:20:56 PM (3 years ago)
Author:
SergeyBiryukov
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #56127, comment 2

    v1 v2  
    11I just updated to WordPress 6.0.2 successfully and then to PHP 8.0. When switching to PHP 8.0, I got the same error mentioned:
    22
    3     Fatal error: Uncaught ArgumentCountError: Too few arguments to function WP_Widget::__construct(), 0 passed in /wp-includes/class-wp-widget-factory.php on line 61 and at least 2 expected in /wp-includes/class-wp-widget.php:162
     3`Fatal error: Uncaught ArgumentCountError: Too few arguments to function WP_Widget::__construct(), 0 passed in /wp-includes/class-wp-widget-factory.php on line 61 and at least 2 expected in /wp-includes/class-wp-widget.php:162`
    44
    55The code can be seen in the release code for WordPress 6.0.2 https://github.com/WordPress/WordPress/blob/6.0.2/wp-includes/class-wp-widget-factory.php#L61.
     
    99For me the call stack has the Video widget of the FullScene theme https://themeforest.net/item/fullscene-portfolio-photography-wp-theme/1617432, which is probably not compatible with WordPress 6. It appears to be passing a string instead of an instance of WP_Widget, but I assume the code path should allow this.
    1010
    11    Stack trace: #0 /wp-includes/class-wp-widget-factory.php(61): WP_Widget->__construct() #1 /wp-includes/widgets.php(115): WP_Widget_Factory->register('Video_Widget') #2 /wp-content/themes/fullscene/functions/widget-video.php(6): register_widget('Video_Widget') #3 /wp-includes/class-wp-hook.php(307): pt_video_widget('') #4 /wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters(NULL, Array) #5 /wp-includes/plugin.php(476): WP_Hook->do_action(Array) #6 /wp-includes/widgets.php(1854): do_action('widgets_init') #7 /wp-includes/class-wp-hook.php(307): wp_widgets_init('') #8 /wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters(NULL, Array) #9 /wp-includes/plugin.php(476): WP_Hook->do_action(Array) #10 /wp-settings.php(598): do_action('init') #11 /wp-config.php(90): require_once('/customers/9/c/...') #12 /wp-load.php(50): require_once('/customers/9/c/...') #13 /wp-admin/admin.php(34): require_once('/customers/9/c/...') #14 /wp-admin/options-general.php(10): require_once('/customers/9/c/...') #15 {main} thrown in /wp-includes/class-wp-widget.php on line 162
     11{{{
     12Stack trace:
     13#0 /wp-includes/class-wp-widget-factory.php(61): WP_Widget->__construct()
     14#1 /wp-includes/widgets.php(115): WP_Widget_Factory->register('Video_Widget')
     15#2 /wp-content/themes/fullscene/functions/widget-video.php(6): register_widget('Video_Widget')
     16#3 /wp-includes/class-wp-hook.php(307): pt_video_widget('')
     17#4 /wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters(NULL, Array)
     18#5 /wp-includes/plugin.php(476): WP_Hook->do_action(Array)
     19#6 /wp-includes/widgets.php(1854): do_action('widgets_init')
     20#7 /wp-includes/class-wp-hook.php(307): wp_widgets_init('')
     21#8 /wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters(NULL, Array)
     22#9 /wp-includes/plugin.php(476): WP_Hook->do_action(Array)
     23#10 /wp-settings.php(598): do_action('init')
     24#11 /wp-config.php(90): require_once('/customers/9/c/...')
     25#12 /wp-load.php(50): require_once('/customers/9/c/...')
     26#13 /wp-admin/admin.php(34): require_once('/customers/9/c/...')
     27#14 /wp-admin/options-general.php(10): require_once('/customers/9/c/...')
     28#15 {main} thrown in /wp-includes/class-wp-widget.php on line 162
     29}}}