If you build a view where the Order is loaded through a relationship that is not required and add the 'Order Balance' field, the rows without orders will cause 500 errors and stop the site from working at all.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | 1728242-balance_field_fail_nicely_with_no_order-1.patch | 888 bytes | rlmumford |
Comments
Comment #1
rlmumfordHere's a patch that solves the immediate problem. I don't know if there should be a check that comes before this.
Comment #2
rszrama commentedWhen checking to ensure we have an order, I also like to load the order and ensure a valid order was returned in case the order ID no longer exists for some reason. I also noticed this code could be better optimized, though, so I shortened the function and changed the output of the "raw" display format to match the raw format for price fields.
Commit: http://drupalcode.org/project/commerce.git/commitdiff/b3c349b