[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 03:03:33 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:  General                        |     Version:  6.1
 Severity:  normal                         |  Resolution:
 Keywords:  needs-patch reporter-feedback  |     Focuses:
-------------------------------------------+------------------------------
Changes (by dd32):

 * keywords:  needs-patch => needs-patch reporter-feedback


Comment:

 Hi @konyoldeath,

 It sounds like some code is passing the incorrect value to the function.
 Would you be able to do some more debugging to determine what's calling
 `wp_list_pluck()`?

 The simplest way would be inspecting the return value of
 [https://developer.wordpress.org/reference/functions/wp_debug_backtrace_summary/
 wp_debug_backtrace_summary()] on the line preceding it:

 {{{
                         foreach ( $this->output as $key => $value ) {
                                 if ( is_object( $value ) ) {
                                         $newlist[ $key ] = $value->$field;
                                 } else {
                                         // Debugging:
                                         if ( ! is_array( $value ) ) {
                                                 error_log(
 wp_debug_backtrace_summary() );
                                                 // or, show it:
                                                 // var_dump(
 wp_debug_backtrace_summary() );
                                         }
                                         $newlist[ $key ] = $value[ $field
 ];
                                 }
                         }
 }}}

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


More information about the wp-trac mailing list