Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#47774 closed defect (bug) (invalid)

PHP 7.2 > Warning: count(): Parameter must be an array or an object that implements Countable in .../wp-admin/user-edit.php on line 285

Reported by: denismack's profile denismack Owned by:
Milestone: Priority: normal
Severity: normal Version: 5.2.2
Component: Users Keywords: has-patch
Focuses: administration Cc:

Description

Count() no longer returns null.
Incompatible with PHP > 7.2

<core>/wp-admin/user-edit.php on line 285:

<?php
if ( count( $_wp_admin_css_colors ) > 1 && has_action( 'admin_color_scheme_picker' ) ) :
<?php
if ( is_array( $_wp_admin_css_colors ) && count( $_wp_admin_css_colors ) > 1 && has_action( 'admin_color_scheme_picker' ) ) :

Fixed count(): Parameter must be an array

Change History (3)

#1 follow-up: @jorbin
5 years ago

  • Keywords reporter-feedback added

Can you provide steps to reproduce this? Using a stock install of WordPress, I'm unable to replicate it. It would appear as though a piece of custom code is overriding the global variable $_wp_admin_css_colors and that is causing the notice for you.

#2 in reply to: ↑ 1 @denismack
5 years ago

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

Replying to jorbin:

Can you provide steps to reproduce this? Using a stock install of WordPress, I'm unable to replicate it. It would appear as though a piece of custom code is overriding the global variable $_wp_admin_css_colors and that is causing the notice for you.

You're right. It's a plugin error while overwriting the $ _wp_admin_css_colors global variable.

Thank you @jorbin

#3 @SergeyBiryukov
5 years ago

  • Focuses administration added
  • Keywords reporter-feedback removed
  • Milestone Awaiting Review deleted

Thanks for the follow-up!

Note: See TracTickets for help on using tickets.