[wp-trac] [WordPress Trac] #42860: PHP 7.2 warning - Parameter must be an array or an object that implements Countable in /wp-includes/class-wp-query.php on line 3035

WordPress Trac noreply at wordpress.org
Mon Dec 11 06:31:58 UTC 2017


#42860: PHP 7.2 warning - Parameter must be an array or an object that implements
Countable in /wp-includes/class-wp-query.php on line 3035
-------------------------------+--------------------
 Reporter:  lisota             |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  4.9.2
Component:  Query              |     Version:  4.9.1
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+--------------------

Comment (by dd32):

 After looking over this, I can only assume that there's a caching plugin
 in play which has set `$this->request` to `null` or `''` which causes
 `$this->posts` to be set to the same thing instead of an array as
 expected.

 The correct fix here is probably to ensure that `$this->posts` is always
 set to an array, even when `$this->request` is emptied out.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/42860#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list