Closed (fixed)
Project:
Ubercart
Version:
7.x-3.x-dev
Component:
Products
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
13 May 2011 at 18:32 UTC
Updated:
6 Jun 2011 at 22:11 UTC
If the nid of a non-existent product is passed to uc_product_get_picture(), a PHP "trying to get property of non-object" notice is generated at line 1784 (the program is trying to access a $node->type. This is also a problem for the upgrade of uc_coupon, because we insert a non-product in the cart with a nid=0 in order to show the coupon on the cart display page.
The attached patch checks for a valid $node and returns an empty array before proceeding. The behavior is exactly the same, but the notice is suppressed.
| Comment | File | Size | Author |
|---|---|---|---|
| uc_product-get-picture-check.patch | 487 bytes | wodenx |
Comments
Comment #1
tr commentedComment #2
longwaveCommitted, thanks for the patch.