This is my first issue/bug report so any advice or feedback would be great!

The item passed to hook_cart_item() may not be the right item. This function re-pulls the items from the database. Upon doing so, it only matches on the node id and cart id. This leads to the wrong item possibly be passed along to the hook. It should also match on serialize($data). I've attached a patch that addresses this issue.

CommentFileSizeAuthor
#1 ubercart-636816-1.patch1.09 KBkalgalath

Comments

kalgalath’s picture

Status: Active » Needs review
StatusFileSize
new1.09 KB
tr’s picture

Bumping this one up so I remember to test it.

omniverse’s picture

I was having the same problem. You can test it by using attributes. Put two of the same product in the cart with different attribute values. Check the remove box when viewing the cart and update the cart. Sometimes the wrong item will be removed depending on the order that they were added since the SELECT query in uc_cart_remove_item is only looking at the nid value of the item (but the DELETE query matches on the data column as well).

Patch fixes it.

Although, big picture, it would probably be best to match on the cart item id instead of nid + cid + data.

longwave’s picture