Custom Fields
Re-Envisioned
Support Meta Box Columns Invalid argument supplied for foreach()

  • Creator
    Topic
  • #30289
    agorski
    Participant

    Logging the following warning: Invalid argument supplied for foreach() in /Users/alexgorski/Code/jbfc/mainsite-wp/public/wp-content/plugins/meta-box-columns/src/Processor.php on line 73

    The value of meta_box[columns] is 12 instead of the expected array. This started happening when I upgraded to 1.2.9 (from a much older version) and is still occurring with 1.2.13.

    Here is log and offending function:

    [16-Aug-2021 14:59:07 UTC] PHP Warning: Invalid argument supplied for foreach() in /mainsite-wp/public/wp-content/plugins/meta-box-columns/src/Processor.php on line 73
    [16-Aug-2021 14:59:07 UTC] printing meta_box[columns]
    [16-Aug-2021 14:59:07 UTC] 12

    /**
    * Fetch and store column data from meta box.
    */
    protected function parse_columns() {
    if ( empty( $this->meta_box['columns'] ) ) {
    return;
    }
    foreach ( $this->meta_box['columns'] as $key => $column ) {
    $this->columns[ sanitize_key( $key ) ] = $this->parse_column( $column );
    }
    error_log("printing meta_box[columns]");
    error_log($this->meta_box['columns']);
    $this->has_columns = true;
    }

Viewing 1 replies (of 1 total)
  • Author
    Replies
  • #30302
    Long Nguyen
    Moderator

    Hi,

    Thank you for your feedback.

    I've escalated this issue to the development team to fix it in the next update.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.