Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
It seems I am able to delete the default Customer Billing Profile field for the Order Entity.
Without it the commerce (checkout) is broken.
Error
The website encountered an unexpected error. Please try again later.Error message EntityMetadataWrapperException: Unknown data property commerce_customer_billing. in EntityStructureWrapper->getPropertyInfo() (line 339 of drupal_path/sites/all/modules/contrib/entity/includes/entity.wrapper.inc).
Shouldn't be locked somehow?
Comment | File | Size | Author |
---|---|---|---|
#8 | Order_Customer_Billing_Profile_locked-1612502-8.patch | 2.31 KB | cvangysel |
#6 | Order_Customer_Billing_Profile_locked-1612502-6.patch | 4.77 KB | vasike |
#1 | Order_Customer_Billing_Profile_locked-1612502-1.patch | 1.17 KB | vasike |
Comments
Comment #1
vasikehere is a patch
i don't know if this should be the solution, or it's ok to have this field unlocked and to fix the bug within checkout module.
Comment #2
rszrama CreditAttribution: rszrama commentedWe actually don't require this on purpose, allowing sites to remove the default billing profile association if they so choose. In that case, I'm guessing checkout was broken for you because you were still showing the billing information checkout pane. If you disable that, it should not provide errors, or if you were to add a different customer profile reference field to your order bundle, then you could update the checkout pane settings to use that field instead.
Perhaps the real fix here to preserve this behavior would be to disable the billing information checkout pane if the customer profile reference field it's been configured to use is removed from the order bundle.
Comment #3
vasikei see,
so where do you think this fix should take place, in which module? checkout or customer?
Comment #4
vasikethere's something else:
I delete the Customer Billing field.
I save the 'Billing information' checkout pane with NO Related customer profile reference field
I go the checkout page
Surprise i have the Billing information inputs right in the checkout form.
and The data is saved the Address (commerce_customer_address) field tables.
How it should be the right way?
I' m thinking to have a validation for this Customer checkout pane and disable it if there's no Related customer profile reference field selected.
Comment #5
rszrama CreditAttribution: rszrama commentedSounds like we should also then make sure that pane is not enabled without a valid reference field selected. : D
We can patch both of these issues in the Customer module.
Comment #6
vasikehere is patch for this (rough stuff).
i found 2 more cases:
Comment #7
cvangysel CreditAttribution: cvangysel commentedI'll have a look at this.
Comment #8
cvangysel CreditAttribution: cvangysel commentedI cleaned up the code a bit and removed some of the hacky stuff. The only thing I don't necessarily like about my patch is that the error message when trying to move a customer profile pane that hasn't got a customer profile referenced is a little general.
But then again, when you're deleting entity fields I guess you should know what it is you're doing.
Comment #9
joshmillerPatch looks clean; Confirmed bug (wow!); Applied patch; Bug immediately fixed; Re-installed site and bug is non-existant.
All is well and bug is gone. Love the hook_field_delete_field() ... not sure what it does or why it's necessary.
Comment #10
rszrama CreditAttribution: rszrama commentedAlrighty, in she goes. As for that function, Josh, it basically updates any checkout panes that may have been based on the customer profile reference field to disable them. And agreed w/ Christophe - if you're deleting these fields, you should know what you're doing. No need to go overboard on the error messages. : )
Thanks to vasike for starting this out and the others for driving it home.