[wp-trac] [WordPress Trac] #57446: Theme switch, retrieve_widgets(), and malformed/missing sidebars_widgets leading to fatal error
WordPress Trac
noreply at wordpress.org
Wed Jan 11 21:28:00 UTC 2023
#57446: Theme switch, retrieve_widgets(), and malformed/missing sidebars_widgets
leading to fatal error
--------------------------+------------------------------
Reporter: verygoode | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Widgets | Version: 6.1.1
Severity: normal | Resolution:
Keywords: | Focuses:
--------------------------+------------------------------
Comment (by verygoode):
To prevent the issue on a site that hasn't switched themes yet, it's
possible to repair theme_mods by adding a sidebars_widgets array.
E.g.
`a:3:{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;s:16:"sidebars_widgets";a:0:{}}`
However, for a site already affected, it doesn't make a difference.
Seems `retrieve_widgets()`'s `unset( $sidebars_widgets['array_version']
);` needs safeguards like what was added to `wp_get_sidebars_widgets()`
via https://core.trac.wordpress.org/changeset/14320
--
Ticket URL: <https://core.trac.wordpress.org/ticket/57446#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list