On the first loop this function checks that the commerce_product property exists on the line_item entity like this:

    if (!in_array('commerce_product', array_keys($line_item_wrapper->getPropertyInfo()))) {
      continue;
    }

But then on the second loop it does not do the same verification. If there is a non-product line item, such as shipping, on the order this will cause a fatal error.

Comments

daggerhart created an issue. See original summary.

daggerhart’s picture

Status: Active » Needs review
StatusFileSize
new777 bytes

Attached is a patch that skips over non-product line items in the second loop of the commerce_rma_new_return_is_possible() function.

daggerhart’s picture

Assigned: daggerhart » Unassigned