Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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 CreditAttribution: 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