Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#55912 closed defect (bug) (invalid)

count( $_wp_admin_css_colors ) in user-edit.php not php 8 friendly when int given

Reported by: rambillo's profile rambillo Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Users Keywords: php8
Focuses: Cc:

Description

Running WordPress core v6.0 with PHP v8.0.14, all plugins turned off, and a default theme (on a long running installation of WordPress), we're getting:

Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, int given in /.../wp-admin/user-edit.php:303 Stack trace: #0 /.../wp-admin/profile.php(18): require_once() #1 {main} thrown in /.../wp-admin/user-edit.php on line 303

There has been a critical error on this website. Please check your site admin email inbox for instructions.

The code on that line suggests it could be addressed via:

if ( is_countable( $_wp_admin_css_colors ) && count( $_wp_admin_css_colors ) > 1 && has_action( 'admin_color_scheme_picker' ) ) : ?>

Change History (2)

#1 @rambillo
3 years ago

  • Resolution set to invalid
  • Status changed from new to closed

Disregard. The issue was between the seat and the keyboard.

#2 @SergeyBiryukov
3 years ago

  • Keywords php8 added
  • Milestone Awaiting Review deleted

No worries, thanks for the follow-up!

As far as I can tell, this can only happen if a plugin or theme unregisters the default admin colors or overwrites the $_wp_admin_css_colors global.

Note: See TracTickets for help on using tickets.