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,
    );
CommentFileSizeAuthor
#1 missing_UCfields.patch981 bytesmattcasey
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mattcasey’s picture

FileSize
981 bytes

I setup Git and created my first patch, and attached it here. Not sure if instead I should try to push to Git or something?

mattcasey’s picture

Status: Active » Needs review
larowlan’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to go from here.
Will commit shortly.

Jens Peter’s picture

Version: 7.x-1.x-dev » 7.x-1.0-alpha1

Solved the error for me. Thank you for this patch.

larowlan’s picture

Status: Reviewed & tested by the community » Fixed

Committed to dev version

Status: Fixed » Closed (fixed)

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