Right now, customer profile types are only configured when the Customer module is enabled. If a module defining a new profile type is later enabled, it will not receive the same configuration step. Also, the configuration process currently presumes the addition of an address field to every profile type, which might not be necessary. I think we might instead add a property to customer profile types that indicates whether or not the Customer module should perform the configuration steps on it to add an address field.

At the same time, the order module is only creating reference fields for profile types that exist when it is first enabled. It should also be checking when other modules are enabled that define new profile types.

Comments

rszrama’s picture

Issue tags: +beta blocker

Tagging.

pcambra’s picture

rszrama’s picture

Status: Needs review » Fixed

Committed with various changes. One bug was that you converted commerce_customer_configure_customer_profile_type() to accept a profile type array but didn't update commerce_customer_enable() to pass in arrays... it was still just passing a type string. For consistency, I also used the variable name $profile_type and $profile_types from the specification.

I reverted the change from $field['settings']['profile_type'] to $instance['settings']['profile_type'][0] as I actually think it's a fluke of my inappropriate field creation code that the customer profile type is in the instance settings array. We aren't using hook_field_instance_settings_form() but hook_field_settings_form(), so every customer profile reference field must specify a single profile type (it's a radios list). Unless we change this to be an instance setting in the future, I think we should leave this as getting the setting from the field array.

There are various other changes you can find in the commit log... don't feel like listing them all out in here. : D

We'll need to tests for the various pieces of functionality in here, as I don't trust myself just clicking through things to make sure it all works. Still, it does all appear to work as advertised.

Status: Fixed » Closed (fixed)
Issue tags: -beta blocker

Automatically closed -- issue fixed for 2 weeks with no activity.