Home Forums WoodMart support forum Error “Warning: in_array() expects parameter 2 to be array”

Error “Warning: in_array() expects parameter 2 to be array”

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #629048

    voltraider
    Participant

    Hello,

    I’ve encountered an issue with the Woodmart theme. When uploading product images via the official WooCommerce mobile app, I’m getting the following error on the product page:

    Warning: in_array() expects parameter 2 to be array, string given in /home/miashoes/mia-shoes.com/www/wp-content/themes/woodmart/inc/modules/parts-css-files/class-parts-css-files.php on line 432
    The error seems to originate in the enqueue_inline_style() function. The problematic part of the code is:

    Ploblem Line – if ( ! isset( $config[ $key ] ) || in_array( $key, $page_files, true ) || ( woodmart_is_combined_needed( ‘combined_css’ ) && ! $ignore_combined ) || isset( $GLOBALS[‘wd_page_css_ignore’] ) ) {
    return;
    }

    It seems that the variable $page_files is not always an array, which causes in_array() to throw this error.

    When I save the product via the standard WordPress editor (not the WooCommerce app), the error disappears. This makes me think it might be related to how the WooCommerce app saves product data.

    #629152

    Artem Temos
    Keymaster

    Hello,

    Could you please record a short video and describe how can we reproduce the issue on your website so we can check this for you?

    Kind Regards

Viewing 2 posts - 1 through 2 (of 2 total)