In uc_taxes_uc_cart_view_form_alter() and uc_taxes_uc_cart_item() the price of an item in the cart is modified to include taxes where applicable. Can there could first be a check to see if the item is a valid node?

I know that, strictly speaking, there should never be a non-node in the cart, but it's sometimes useful to show something in the cart other than a product, and there's no easy way to do this other than adding it as a "fake" cart item (this is the strategy used by uc_coupon). This currently produces some runtime "property of non-object" notices. The attached patch prevents this.

CommentFileSizeAuthor
uc_taxes-check-for-valid-node.patch1.87 KBwodenx

Comments

wodenx’s picture

Note: this is connected to #1156930: uc_product_get_picture should check for valid node. Another, less black-magical way of dealing with this would be to standardize the way uc_cart displays items accross the three contexts (cart page, cart block and cart checkout pane) - say, to use a tapir table in all three. This would make it easier to add something to the cart display without actually adding it to the cart. But that's a more extensive rewrite.

longwave’s picture

Status: Needs review » Fixed

Committed, thanks for the patch.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.