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.
We should check that the entity has fields (ie: commerce_customer_shipping) before attempting to set their value in commerce_addressbook_commerce_order_insert(). Even though, order bundles aren't recommended in the current version of commerce, this module dies fatally when using them because of this bug.
Here's a patch does the check using the wrappers getPropertyInfo() method. We could use field_info_instance or something else if that's preferred, but this works for me.
Comment | File | Size | Author |
---|---|---|---|
commerce-addressbook_check_entity_property_info_before_setting_defaults.patch | 876 bytes | andyg5000 |
Comments
Comment #1
akosipax CreditAttribution: akosipax commentedLooks good!
Comment #2
mglamanLooks like this was fixed in #2070643: Default address not always used in checkout pane and checks field instances for the order bundle.