Commit 9c02d5d9 authored by Dima Sukharchuk's avatar Dima Sukharchuk Committed by Ryan Szrama
Browse files

Issue #3258397 by arraksis, rszrama: Warning: reset() expects parameter 1 to...

Issue #3258397 by arraksis, rszrama: Warning: reset() expects parameter 1 to be array, null given after upgrade to 7.x-1.16
parent e791750f
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -1770,7 +1770,12 @@ function _commerce_cart_matching_products($products, &$form_state) {
      // Store which attributes this product is associated with.
      foreach ($attributes as $attribute_name => $attribute_value) {
        $product_attribute_items = field_get_items('commerce_product', $product, $attribute_name);
        if (!empty($product_attribute_items[0])) {
          $product_attribute_value = reset($product_attribute_items[0]);
        }
        else {
          $product_attribute_value = NULL;
        }

        if ($product_attribute_value == $attribute_value) {
          $attributes_products[$attribute_name][$product_id] = $product;