[wp-trac] [WordPress Trac] #47395: Countable Error in meta.php

WordPress Trac noreply at wordpress.org
Sun May 26 23:32:06 UTC 2019


#47395: Countable Error in meta.php
-------------------------------+-----------------------------
 Reporter:  mattgates          |      Owner:  (none)
     Type:  defect (bug)       |     Status:  new
 Priority:  normal             |  Milestone:  Awaiting Review
Component:  Posts, Post Types  |    Version:  5.2.1
 Severity:  blocker            |   Keywords:
  Focuses:                     |
-------------------------------+-----------------------------
 Warning: count(): Parameter must be an array or an object that implements
 Countable in wp-includes/meta.php on line 210

 This error prevents any posts from being updated. It seems it is erroring
 because $old_value may not always be an array.

 This is the original line that causes errors:

 {{{if ( count( $old_value ) == 1 ) {}}}


 The fix checks to see if $old_value is an object or array:

 {{{if ( (is_array($old_value) || is_object($old_value)) && count(
 $old_value ) == 1 ) {}}}




 After fix is implemented, everything seems to work fine.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/47395>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list