[wp-trac] [WordPress Trac] #56948: (WordPress 6.1) Trying to access array offset on value of type int in wp-includes/class-wp-list-util.php on line 170

WordPress Trac noreply at wordpress.org
Wed Nov 2 04:01:07 UTC 2022


#56948: (WordPress 6.1) Trying to access array offset on value of type int in wp-
includes/class-wp-list-util.php on line 170
--------------------------+------------------------------
 Reporter:  konyoldeath   |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Query         |     Version:  6.1
 Severity:  normal        |  Resolution:
 Keywords:  needs-patch   |     Focuses:
--------------------------+------------------------------
Changes (by dd32):

 * keywords:  needs-patch reporter-feedback => needs-patch
 * component:  General => Query


Comment:

 Thank you @konyoldeath that helps a great deal!

 Looks like Astra calls `WP_Query( [ 'fields' => 'ids', ... ] )` and then
 loops over that, so `$this->posts` is an array of ints, not an array of
 posts.

 Astra [https://developers.wpastra.com/astra-
 theme/reference/classes/astra_related_posts_markup/astra_get_related_posts/
 Loop] and [https://developers.wpastra.com/astra-
 theme/reference/classes/astra_related_posts_markup/astra_get_related_posts_by_query/
 the Query].

 I'm not familiar enough with the core code to go further here, but
 documenting the above for others to follow up with.

 Introduced in [53482] / #55716 cc @spacedmonkey, @timothyblynjacobs,
 @peterwilsoncc

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


More information about the wp-trac mailing list