Hello,
I'am building a module where I have a new order bundle defined, let's call it foo. I use commerce_order_configure_order_type('foo') in order to configure it as a basic commerce_order.
I want to integrate functionalities from commerce rma, into my module so I downloaded it, but when comes the time to enable it I face a nice error saying:
WD php: FieldException: Attempt to create an instance of field commerce_customer_rma on forbidden entity [error]
type commerce_order. in field_create_instance() (line 487 of [...]www/modules/field/field.crud.inc).
I have chased this error down and the conclusion is:
This error occur when it reach my commerce_order_configure_order_type('foo') function call, located in hook_install().
This function basically try to attach one customer profile reference fields for each profile type on the given commerce_order type. (see commerce_order_configure_order_type())
So at one point it try to attach a commerce_customer_rma field on my commerce_bpost foo bundle, but this field is already created by commerce_return, and it's only instantiable on commerce_return entities.
Comment | File | Size | Author |
---|---|---|---|
#1 | 2247177-commerce_return-customer_profile_configure.patch | 630 bytes | theo_ |
Comments
Comment #1
theo_ CreditAttribution: theo_ commentedHere is a patch which allow commerce_customer_rma field to be instantiated on both commerce_order and commerce_return.
Comment #2
jkuma CreditAttribution: jkuma commentedI totally agree with your approach and the patch has been merged into the dev branch. Thank you for this one!