_uc_cart_product_get_options() fails with the above error if the $data field does not exist in the product $item. This can happen when previewing a new product and there is a module that implements hook_uc_product_alter(), and that implementation calls _uc_cart_product_get_options().

Yes, you're not really supposed to call underscore functions from outside of that one module, but uc_price_per_role does.

Files: 
CommentFileSizeAuthor
#1 ubercart_undefined_options_data-1897242-1.patch445 bytesDanZ
PASSED: [[SimpleTest]]: [MySQL] 2,798 pass(es).
[ View ]

Comments

Status:Active» Needs review
StatusFileSize
new445 bytes
PASSED: [[SimpleTest]]: [MySQL] 2,798 pass(es).
[ View ]

This little patch fixes it.

Arguably, uc_price_per_role could check this before calling, but I guess this doesn't really hurt anything.

Yes, uc_price_per_role could do the check.

However, that would be a workaround, and won't help other add-on modules. I'd rather have a fix.

Status:Needs review» Fixed

Committed.

Status:Fixed» Closed (fixed)

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

Issue summary:View changes

Grammar.