Opened 5 weeks ago
Last modified 5 weeks ago
#63440 new defect (bug)
6.8.1 Multisite: Uncaught TypeError: array_keys(): Argument #1 ($array) must be of type array, string given in wp-includes/class-wp-roles.php:291
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | major | Version: | |
Component: | Role/Capability | Keywords: | reporter-feedback |
Focuses: | administration, multisite | Cc: |
Description (last modified by )
I held off upgrading to 6.8 because of the multisite issue with older sites. I saw that bug was fixed in 6.8.1, but on upgrading I saw this error:
Fatal error: Uncaught TypeError: array_keys(): Argument #1 ($array) must be of type array, string given in /.../wp-includes/class-wp-roles.php:291 Stack trace: #0 /.../wp-includes/class-wp-roles.php(291): array_keys() #1 /.../wp-includes/class-wp-roles.php(332): WP_Roles->init_roles() #2 /.../wp-includes/ms-blogs.php(707): WP_Roles->for_site() #3 /.../wp-includes/class-wp-hook.php(326): wp_switch_roles_and_user() #4 /.../wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() #5 /.../wp-includes/plugin.php(517): WP_Hook->do_action() #6 /.../wp-includes/ms-blogs.php(587): do_action() #7 /.../wp-includes/admin-bar.php(685): switch_to_blog() #8 /.../wp-includes/class-wp-hook.php(324): wp_admin_bar_my_sites_menu() #9 /.../wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() #10 /.../wp-includes/plugin.php(565): WP_Hook->do_action() #11 /.../wp-includes/admin-bar.php(97): do_action_ref_array() #12 /.../wp-includes/class-wp-hook.php(324): wp_admin_bar_render() #13 /.../wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() #14 /.../wp-includes/plugin.php(517): WP_Hook->do_action() #15 /.../wp-admin/admin-header.php(277): do_action() #16 /.../wp-admin/edit-form-blocks.php(376): require_once('...') #17 /.../wp-admin/post.php(187): require('...') #18 {main} thrown in /.../wp-includes/class-wp-roles.php on line 291
Strangely, the side admin bar renders, but the top admin bar doesn't.
Change History (3)
#1
@
5 weeks ago
- Component changed from Administration to Role/Capability
- Description modified (diff)
- Focuses administration multisite added
#2
@
5 weeks ago
- Keywords reporter-feedback added
Hi there welcome to WordPress Trac!
The error message refers to the WP_Roles::$roles
property, which should only ever be an array, but it appears to be changed to a string for some reason, most likely by a plugin or theme.
Does the issue still happens with all plugins disabled and a default theme (Twenty Twenty-Five) activated?
Note: See
TracTickets for help on using
tickets.
I'll move this to the "Role/Capability" component, but the issue involves
switch_to_blog()
in the toolbar'swp_admin_bar_my_sites_menu()
function.Do you find the error on any page (administration and/or front end), or is it only certain pages?