PHP Warning rying to access array offset on value of type bool
-
Howdy folks!
Recently, I am seeing the error below:
[24-Jun-2025 12:45:49 UTC] PHP Warning: Trying to access array offset on value of type bool in /home/.../wp-content/plugins/judgeme-product-reviews-woocommerce/includes/class-jgm-productservice.php on line 329it’s related to the block starting on lines 320-330.
$product = array(
'id' => $id,
'title' => $title,
'handle' => $handle,
'vendor' => $vendor, //Should not require vendor!!
'in_store' => $in_store,
'image_url' => $image_url[0],
'small_image_url' => $small_image_url[0],
'medium_image_url' => $medium_image_url[0],
'tags' => implode( ', ', $term_array ),
'path' => str_replace(home_url(), '', get_permalink($id)),
);I believe that we need to check if it’s really returning an array to avoid bool, something like:
'image_url' => is_array($image_url) ? $image_url[0] : '',
'small_image_url' => is_array($small_image_url) ? $small_image_url[0] : '',
'medium_image_url' => is_array($medium_image_url) ? $medium_image_url[0] : '',Would it be possible for you folks to take a look at it and provide an official fix?
Thanks!
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
The topic ‘PHP Warning rying to access array offset on value of type bool’ is closed to new replies.