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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

theo_’s picture

Status: Active » Needs review
FileSize
630 bytes

Here is a patch which allow commerce_customer_rma field to be instantiated on both commerce_order and commerce_return.

jkuma’s picture

Status: Needs review » Fixed

I totally agree with your approach and the patch has been merged into the dev branch. Thank you for this one!

  • Commit 24921bc on 7.x-2.x authored by theo_, committed by goldorak:
    Issue #2247177 by theo_: Conflict with rma customer profile when...

  • Commit 24921bc on 7.x-2.x, 7.x-2.x-goldorak authored by theo_, committed by goldorak:
    Issue #2247177 by theo_: Conflict with rma customer profile when...

Status: Fixed » Closed (fixed)

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