This error is likely related to the following issues, but I felt it necessary to create a new issue:

http://drupal.org/node/1361562
http://drupal.org/node/1473286

When enabling the commerce_product module after it has been disabled the following PHP exception is thrown:

FieldException: Attempt to create an instance of field commerce_price on bundle product that already has an instance of that field. in field_create_instance() (line 490 of [site]/modules/field/field.crud.inc).

Comments

andyg5000’s picture

I've attached a simple patch that checks for existing and disabled fields before calling commerce_price_create_instance to prevent this error from being thrown. It is likely that a similar patch could fix the error in http://drupal.org/node/1361562.

andyg5000’s picture

Status: Active » Needs review

Setting as needs review

Peter Kashpurenko’s picture

Status: Closed (duplicate) » Needs review
andyg5000’s picture

Status: Needs review » Closed (duplicate)

@bojanz explained to me that fields should not be created during hook_enable which is the root cause of this issue. The patch above fixes the fatal error for enabling commerce_product and could also be adapted to other sub modules of commerce. However, they do not fix the underlying problem discussed in http://drupal.org/node/1361562. Closing as duplicate.

Status: Needs review » Closed (duplicate)