Notice: Undefined property: stdClass::$commerce_product in commerce_decimal_quantities_form_commerce_order_ui_order_form_alter() (line 81 in /sites/all/modules/contrib/commerce_decimal_quantities/commerce_decimal_quantities.module).
Warning: Invalid argument supplied for foreach() in commerce_decimal_quantities_form_commerce_order_ui_order_form_alter() (line 81 in /sites/all/modules/contrib/commerce_decimal_quantities/commerce_decimal_quantities.module).

This problem occurs when order have line item without product reference like shipping line item.

Comments

5n00py’s picture

Status: Active » Needs review
StatusFileSize
new2.53 KB

Very simple patch :)

guy_schneerson’s picture

Thanks @5n00py, looks good will try and review and commit soon

5n00py’s picture

@guy_schneerson Any progress?

guy_schneerson’s picture

This patch fixes the problem however the original code should ideally be reviewed as it should use commerce_product_line_item_types() to check if line item is a product and also the second loop look may be redundant.

committed http://drupalcode.org/project/commerce_decimal_quantities.git/commit/c18...

guy_schneerson’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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

GaborTorok’s picture

Status: Closed (fixed) » Needs review
StatusFileSize
new1.95 KB

This problem was reintroduced at another place with the addition of commerce_decimal_quantities_field_widget_form_alter() in commit http://drupalcode.org/project/commerce_decimal_quantities.git/commit/33b...

I inserted a check that solves the problem for me. Patch attached.

guy_schneerson’s picture

thanks @GaborTorok will review and commit

5n00py’s picture

Status: Needs review » Reviewed & tested by the community

I'll test patch from #7. It fix the problem and everything looks good!

guy_schneerson’s picture

Status: Reviewed & tested by the community » Fixed

Thanks @GaborTorok & @5n00py great work
Committed http://drupalcode.org/project/commerce_decimal_quantities.git/commit/06d...

Status: Fixed » Closed (fixed)

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