When you try to create a line item type, it fails with this error message in the last version:
FieldException: Attempt to create an instance of field commerce_unit_price without a bundle. in field_create_instance()

Moving the cache clear to the top fixes the error, patch attached

Comments

davisben’s picture

Status: Active » Reviewed & tested by the community

The patch fixes this for me.

idflood’s picture

This patch looks good and works well for me too, thanks @pcambra!

rszrama’s picture

Status: Reviewed & tested by the community » Fixed

The issue was really with postponing the line item types reset. I'm not sure when / why we put it in there with the menu_rebuild() or why it's been working until recently, but I moved it out write after the drupal_write_record() so it always happens whether the skip parameter was set to TRUE or not. Additionally, instead of calling menu_rebuild() directly, I've changed this to use the menu_rebuild_needed variable we use in the core Commerce modules to signal menu rebuilds without resulting in multiple rebuilds on a single page request.

I'm going to roll a beta2 with this fix.

Commit: http://drupalcode.org/project/commerce_custom_product.git/commitdiff/672...

Status: Fixed » Closed (fixed)

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

bojanz’s picture

Status: Closed (fixed) » Needs work

This issue renamed $skip_reset to $skip_rebuild, but left a few instances of $skip_reset in the function, leading to
Notice: Undefined variable: skip_reset in commerce_custom_product_line_item_type_save() (line 158 of modules/commerce_custom_product/commerce_custom_product.module).

bojanz’s picture

Status: Needs work » Closed (fixed)

Nevermind, it's fixed in -dev. We should have a new release...