Both of these errors appear on cart and checkout pages, so I've listed them all here along with my solutions:
Notice: Undefined property: stdClass::$weight_units in uc_cart_get_contents() (line 1372 of /home/mcasey666/mbcasey.com/hanlovelights/sites/all/modules/ubercart/uc_cart/uc_cart.module).
Notice: Undefined index: shippable in uc_cart_product_is_shippable() (line 1742 of /home/mcasey666/mbcasey.com/hanlovelights/sites/all/modules/ubercart/uc_cart/uc_cart.module).
$weight_units is a new variable added in Ubercart beta2, compared to the equivalent alpha3 function.
File: hotel_booking.room_type.inc
Start on Line 290:
- $row->sell_price = $row->cost = $row->weight = $row->shippable = FALSE;
+ $row->sell_price = $row->cost = $row->weight = $row->shippable = $row->weight_units = FALSE;
Notice: Undefined index: shippable in uc_cart_product_is_shippable() (line 1741 of /hanlovelights/sites/all/modules/ubercart/uc_cart/uc_cart.module).
This error only occurs if settings in the content type are changed to make the product 'shippable.' Fix only works for nodes added after the change:
Start on Line 581:
$data = array(
'module' => 'hotel_booking',
'prices' => $prices,
'nights' => $nights,
'total' => $total,
'adults' => $adults,
'children' => $children,
+ 'shippable' => FALSE,
);
Comment | File | Size | Author |
---|---|---|---|
#1 | missing_UCfields.patch | 981 bytes | mattcasey |
Comments
Comment #1
mattcasey CreditAttribution: mattcasey commentedI setup Git and created my first patch, and attached it here. Not sure if instead I should try to push to Git or something?
Comment #2
mattcasey CreditAttribution: mattcasey commentedComment #3
larowlanLooks good to go from here.
Will commit shortly.
Comment #4
Jens Peter CreditAttribution: Jens Peter commentedSolved the error for me. Thank you for this patch.
Comment #5
larowlanCommitted to dev version