• Resolved ellasbubbles

    (@ellasbubbles)


    FYI

    Fatal error: Uncaught TypeError: array_search(): Argument #2 ($haystack) must be of type array, null given in ellasbathroom.com/wp-content/plugins/cf-images/app/modules/class-cloudflare-images.php:188 Stack trace: #0 ellasbathroom.com/wp-content/plugins/cf-images/app/modules/class-cloudflare-images.php(188): array_search() #1 ellasbathroom.com/wp-content/plugins/cf-images/app/modules/class-cloudflare-images.php(322): CF_Images\App\Modules\Cloudflare_Images->get_attachment_image_src() #2 ellasbathroom.com/wp-includes/class-wp-hook.php(324): CF_Images\App\Modules\Cloudflare_Images->calculate_image_srcset() #3 ellasbathroom.com/wp-includes/plugin.php(205): WP_Hook->apply_filters() #4 ellasbathroom.com/wp-includes/media.php(1488): apply_filters() #5 ellasbathroom.com/wp-includes/media.php(1127): wp_calculate_image_srcset() #6 ellasbathroom.com/wp-content/plugins/woocommerce/includes/wc-product-functions.php(332): wp_get_attachment_image() #7 ellasbathroom.com/wp-content/plugins/smart-variations-images/includes/class-smart-variations-images.php(233): wc_placeholder_img() #8 ellasbathroom.com/wp-content/plugins/smart-variations-images/includes/class-smart-variations-images.php(88): Smart_Variations_Images->define_public_hooks() #9 ellasbathroom.com/wp-content/plugins/smart-variations-images/svi.php(119): Smart_Variations_Images->__construct() #10 ellasbathroom.com/wp-includes/class-wp-hook.php(324): run_smart_variations_images() #11 ellasbathroom.com/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() #12 ellasbathroom.com/wp-includes/plugin.php(517): WP_Hook->do_action() #13 ellasbathroom.com/wp-settings.php(555): do_action() #14 ellasbathroom.com/wp-config.php(103): require_once(‘…’) #15 ellasbathroom.com/wp-load.php(50): require_once(‘…’) #16 ellasbathroom.com/wp-blog-header.php(13): require_once(‘…’) #17 ellasbathroom.com/index.php(17): require(‘…’) #18 {main} thrown in?ellasbathroom.com/wp-content/plugins/cf-images/app/modules/class-cloudflare-images.php?on line?188

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter ellasbubbles

    (@ellasbubbles)

    RESOLVED: Changing this:

    $height_key = array_search( (int) $variant_image[1], $this->heights, true );
    $width_key = array_search( (int) $variant_image[2], $this->widths, true );

    if ( $width_key && $height_key && $width_key === $height_key && true === $this->registered_sizes[ $width_key ][‘crop’] ) {
    $image[0] = $cf_image . ‘/w=’ . $variant_image[1] . ‘,h=’ . $variant_image[2] . ‘,fit=crop’;
    return $image;
    }

    To this:

    if ( is_array( $this->heights ) && is_array( $this->widths ) ) {
    $height_key = array_search( (int) $variant_image[1], $this->heights, true );
    $width_key = array_search( (int) $variant_image[2], $this->widths, true );

    if ( $width_key && $height_key && $width_key === $height_key && true === $this->registered_sizes[ $width_key ]['crop'] ) {
        $image[0] = $cf_image . '/w=' . $variant_image[1] . ',h=' . $variant_image[2] . ',fit=crop';
        return $image;
    }

    }

    Plugin Author Anton Vanyukov

    (@vanyukov)

    Hi @ellasbubbles,

    Thank you for reporting this. The fix will be in the upcoming release.
    I’ll mark this as resolved.

    Best regards,
    Anton

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