[wp-trac] [WordPress Trac] #57446: Theme Switch, retrieve_widgets() Leading to Fatal Error
WordPress Trac
noreply at wordpress.org
Wed Jan 11 17:25:17 UTC 2023
#57446: Theme Switch, retrieve_widgets() Leading to Fatal Error
--------------------------+------------------------------
Reporter: verygoode | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: 6.1.1
Severity: normal | Resolution:
Keywords: | Focuses:
--------------------------+------------------------------
Comment (by verygoode):
== Related options prior to the theme switch.
**current_theme**
{{{
Enfold Child
}}}
**theme_mods_enfold-child**
No widgets array.
{{{
a:2:{s:18:"nav_menu_locations";a:3:{s:4:"avia";i:73;s:5:"avia2";i:0;s:5:"avia3";i:0;}s:18:"custom_css_post_id";i:2960;}
}}}
**theme_switched**
{{{
empty
}}}
**Errors**
Attempting to access /wp-admin/widgets.php generates the following error.
{{{
[11-Jan-2023 17:16:51 UTC] PHP Warning: Invalid argument supplied for
foreach() in /wordpress/core/6.1.1/wp-admin/widgets-form.php on line 82
[11-Jan-2023 17:16:51 UTC] PHP Fatal error: Uncaught Error: Cannot unset
string offsets in /wordpress/core/6.1.1/wp-includes/widgets.php:1324
Stack trace:
#0 /wordpress/core/6.1.1/wp-admin/widgets-form.php(121):
retrieve_widgets()
#1 /wordpress/core/6.1.1/wp-admin/widgets.php(34):
require('/wordpress/core...')
#2 {main}
thrown in /wordpress/core/6.1.1/wp-includes/widgets.php on line 1324
}}}
----
== Related options after theme switch
Switched to Twenty Twenty-Three
**current_theme**
{{{
Twenty Twenty-Three
}}}
**theme_mods_twentytwentythree**
{{{
a:2:{i:0;b:0;s:18:"nav_menu_locations";a:0:{}}
}}}
**theme_switched**
{{{
enfold-child
}}}
**Errors**
Any attempts to interact with the site leads to the following.
{{{
Fatal error: Uncaught Error: Cannot unset string offsets in
/wordpress/core/6.1.1/wp-includes/widgets.php:1324
Stack trace:
#0 /wordpress/core/6.1.1/wp-includes/widgets.php(1287):
retrieve_widgets(true)
#1 /wordpress/core/6.1.1/wp-includes/class-wp-hook.php(310):
_wp_sidebars_changed('Enfold Child')
#2 /wordpress/core/6.1.1/wp-includes/class-wp-hook.php(332):
WP_Hook->apply_filters(NULL, Array)
#3 /wordpress/core/6.1.1/wp-includes/plugin.php(517):
WP_Hook->do_action(Array)
#4 /wordpress/core/6.1.1/wp-includes/theme.php(3395):
do_action('after_switch_th...', 'Enfold Child', Object(WP_Theme))
#5 /wordpress/core/6.1.1/wp-includes/class-wp-hook.php(308):
check_theme_switched('')
#6 /wordpress/core/6.1.1/wp-includes/class-wp-hook.php(332):
WP_Hook->apply_filters(NULL, Array)
#7 /wordpress/core/6.1.1/wp-includes/plugin.php(517):
WP_Hook->do_action(Array)
#8 /wordpress/core/6.1.1/wp-settings.php(617): do_action('init')
#9 phar:///usr/local/bin/wp-cli/vendor/wp-cli/wp-
cli/php/WP_CLI/Runner.php(1336): require('/wordpress/core...')
#10 phar:///usr/local/bin/wp-cli/vendor/wp-cli/wp-
cli/php/WP_CLI/Runner.php(1254): WP_CLI\Runner->load_wordpress()
#11 phar:///usr/local/bin/wp-cli/vendor/wp-cli/wp-
cli/php/WP_CLI/Bootstrap/LaunchRunner.php(28): WP_CLI\Runner->start()
#12 phar:///usr/local/bin/wp-cli/vendor/wp-cli/wp-
cli/php/bootstrap.php(78):
WP_CLI\Bootstrap\LaunchRunner->process(Object(WP_CLI\Bootstrap\BootstrapState))
#13 phar:///usr/local/bin/wp-cli/vendor/wp-cli/wp-cli/php/wp-cli.php(32):
WP_CLI\bootstrap()
#14 phar:///usr/local/bin/wp-cli/php/boot-phar.php(11):
include('phar:///usr/loc...')
#15 /usr/local/bin/wp-cli(4): include('phar:///usr/loc...')
#16 {main}
thrown in /wordpress/core/6.1.1/wp-includes/widgets.php on line 1324
Error: There has been a critical error on this website.Learn more about
troubleshooting WordPress. There has been a critical error on this
website.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/57446#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list