Hello
I just installed this module today and found that, it has an issue with order load query. I have created a new order whose ID is 200 but when I go to "create new cart" which is at user's profile, it through below errors:
==========================================================
Notice: Trying to get property of non-object in commerce_order_status_update()
Warning: Creating default object from empty value in commerce_order_status_update()
Warning: Creating default object from empty value in CommerceOrderEntityController->save()
EntityMalformedException: Missing bundle property on entity of type commerce_order. in entity_extract_ids()
==========================================================
After digging into that, I found that, there was a old order which status was also set as "cart" (which was created very time ago).
But the "commerce_cart_multiple.module" is loading use's first order with "cart" status as a current order and here it is throwing those notice and warnings.
I found that on line number "151" in "commerce_cart_multiple.module"
$order_id = key($result['commerce_order']);
instead of
end($result['commerce_order'] );
$order_id = key($result['commerce_order']);
Please suggest.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 2825989-latest-order.patch | 612 bytes | spacetaxi |
Comments
Comment #2
spacetaxi commentedComment #3
spacetaxi commentedHi,
It won't matter whether you try and pick the first or last key of the $result['commerce_order'] array because only one result is returned by the query.
However, it looks that while the query is returning the array, the corresponding order associated with the key is empty. I'm not sure why this is happening.
I have uploaded a patch that hopefully prevent trying to load an empty cart. Let me know if this works for you.