Closed (fixed)
Project:
Commerce Customizable Products
Version:
7.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
24 Aug 2012 at 13:54 UTC
Updated:
8 Feb 2013 at 17:05 UTC
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
| Comment | File | Size | Author |
|---|---|---|---|
| commerce_custom_product-fix_fatal_error_bundle.patch | 1.08 KB | pcambra |
Comments
Comment #1
davisbenThe patch fixes this for me.
Comment #2
idflood commentedThis patch looks good and works well for me too, thanks @pcambra!
Comment #3
rszrama commentedThe 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...
Comment #5
bojanz commentedThis 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).
Comment #6
bojanz commentedNevermind, it's fixed in -dev. We should have a new release...