_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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

DanZ’s picture

Status: Active » Needs review
FileSize
445 bytes

This little patch fixes it.

longwave’s picture

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

DanZ’s picture

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.

longwave’s picture

Status: Needs review » Fixed

Committed.

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

Grammar.